NA_B_set_pop_points_effect = {
		every_state = {
				limit = {
					has_state_flag = NA_B_originally_owned_by_usa
				}
				if = {
					limit = {
						check_variable = { var = NA_B_state_pop_points value = 0 compare = greater_than_or_equals }
						check_variable = { var = NA_B_state_pop_points value = 3 compare = less_than }
					}
					subtract_from_variable = { NA_B_mantle_of_the_state_points = 1 }
				}
				else_if = {
					limit = {
						check_variable = { var = NA_B_state_pop_points value = 3 compare = equals }
					}
					subtract_from_variable = { NA_B_mantle_of_the_state_points = 3 }
				}
				else_if = {
					limit = {
						check_variable = { var = NA_B_state_pop_points value = 4 compare = greater_than_or_equals }
						check_variable = { var = NA_B_state_pop_points value = 6 compare = less_than }
					}
					subtract_from_variable = { NA_B_mantle_of_the_state_points = 4 }
				}
				else_if = {
					limit = { check_variable = { var = NA_B_state_pop_points value = 6 compare = equals } }
					subtract_from_variable = { NA_B_mantle_of_the_state_points = 6 }
				}
				else_if = {
					limit = { check_variable = { var = NA_B_state_pop_points value = 7 compare = equals } }
					subtract_from_variable = { NA_B_mantle_of_the_state_points = 8 }
				}
				else_if = {
					limit = { check_variable = { var = NA_B_state_pop_points value = 8 compare = equals } }
					subtract_from_variable = { NA_B_mantle_of_the_state_points = 10 }
				}
				else_if = {
					limit = { check_variable = { var = NA_B_state_pop_points value = 9 compare = equals } }
					subtract_from_variable = { NA_B_mantle_of_the_state_points = 12 }
				}
				else_if = {
					limit = { check_variable = { var = NA_B_state_pop_points value = 10 compare = equals } }
					subtract_from_variable = { NA_B_mantle_of_the_state_points = 14 }
				}
				else_if = {
					limit = { check_variable = { var = NA_B_state_pop_points value = 11 compare = equals } }
					subtract_from_variable = { NA_B_mantle_of_the_state_points = 18 }
				}
				else_if = {
					limit = { check_variable = { var = NA_B_state_pop_points value = 12 compare = equals } }
					subtract_from_variable = { NA_B_mantle_of_the_state_points = 22 }
				}
				else_if = {
					limit = { check_variable = { var = NA_B_state_pop_points value = 13 compare = equals } }
					subtract_from_variable = { NA_B_mantle_of_the_state_points = 26 }
				}
				else_if = {
					limit = { check_variable = { var = NA_B_state_pop_points value = 14 compare = equals } }
					subtract_from_variable = { NA_B_mantle_of_the_state_points = 30 }
				}
				else_if = {
					limit = { check_variable = { var = NA_B_state_pop_points value = 15 compare = equals } }
					subtract_from_variable = { NA_B_mantle_of_the_state_points = 35 }
				}
				else_if = {
					limit = { check_variable = { var = NA_B_state_pop_points value = 16 compare = equals } }
					subtract_from_variable = { NA_B_mantle_of_the_state_points = 40 }
				}
				else_if = {
					limit = { check_variable = { var = NA_B_state_pop_points value = 17 compare = equals } }
					subtract_from_variable = { NA_B_mantle_of_the_state_points = 45 }
				}
				else_if = {
					limit = { check_variable = { var = NA_B_state_pop_points value = 18 compare = equals } }
					subtract_from_variable = { NA_B_mantle_of_the_state_points = 50 }
				}
				else_if = {
					limit = { check_variable = { var = NA_B_state_pop_points value = 19 compare = equals } }
					subtract_from_variable = { NA_B_mantle_of_the_state_points = 55 }
				}
				else_if = {
					limit = { check_variable = { var = NA_B_state_pop_points value = 20 compare = equals } }
					subtract_from_variable = { NA_B_mantle_of_the_state_points = 60 }
				}
				else_if = {
					limit = { check_variable = { var = NA_B_state_pop_points value = 21 compare = equals } }
					subtract_from_variable = { NA_B_mantle_of_the_state_points = 65 }
				}
				else_if = {
					limit = { check_variable = { var = NA_B_state_pop_points value = 22 compare = equals } }
					subtract_from_variable = { NA_B_mantle_of_the_state_points = 70 }
				}
				else_if = {
					limit = { check_variable = { var = NA_B_state_pop_points value = 23 compare = equals } }
					subtract_from_variable = { NA_B_mantle_of_the_state_points = 80 }
				}
				else_if = {
					limit = { check_variable = { var = NA_B_state_pop_points value = 24 compare = equals } }
					subtract_from_variable = { NA_B_mantle_of_the_state_points = 90 }
				}
				else_if = {
					limit = { check_variable = { var = NA_B_state_pop_points value = 25 compare = equals } }
					subtract_from_variable = { NA_B_mantle_of_the_state_points = 100 }
				}
				else_if = {
					limit = { check_variable = { var = NA_B_state_pop_points value = 26 compare = equals } }
					subtract_from_variable = { NA_B_mantle_of_the_state_points = 110 }
				}
				else_if = {
					limit = { check_variable = { var = NA_B_state_pop_points value = 27 compare = equals } }
					subtract_from_variable = { NA_B_mantle_of_the_state_points = 150 }
				}

				if = {
					limit = { state_population < 1000 }
					set_variable = { NA_B_state_pop_points = 0 }
				}
				else_if = {
					limit = { state_population < 10000 }
					set_variable = { NA_B_state_pop_points = 1 }
				}
				else_if = {
					limit = { state_population < 30000 }
					set_variable = { NA_B_state_pop_points = 2 }
				}
				else_if = {
					limit = { state_population < 50000 }
					set_variable = { NA_B_state_pop_points = 3 }
				}
				else_if = {
					limit = { state_population < 80000 }
					set_variable = { NA_B_state_pop_points = 4 }
				}
				else_if = {
					limit = { state_population < 100000 }
					set_variable = { NA_B_state_pop_points = 5 }
				}
				else_if = {
					limit = { state_population < 200000 }
					set_variable = { NA_B_state_pop_points = 6 }
				}
				else_if = {
					limit = { state_population < 300000 }
					set_variable = { NA_B_state_pop_points = 7 }
				}
				else_if = {
					limit = { state_population < 400000 }
					set_variable = { NA_B_state_pop_points = 8 }
				}
				else_if = {
					limit = { state_population < 500000 }
					set_variable = { NA_B_state_pop_points = 9 }
				}
				else_if = {
					limit = { state_population < 600000 }
					set_variable = { NA_B_state_pop_points = 10 }
				}
				else_if = {
					limit = { state_population < 700000 }
					set_variable = { NA_B_state_pop_points = 11 }
				}
				else_if = {
					limit = { state_population < 800000 }
					set_variable = { NA_B_state_pop_points = 12 }
				}
				else_if = {
					limit = { state_population < 900000 }
					set_variable = { NA_B_state_pop_points = 13 }
				}
				else_if = {
					limit = { state_population < 1000000 }
					set_variable = { NA_B_state_pop_points = 14 }
				}
				else_if = {
					limit = { state_population < 1250000 }
					set_variable = { NA_B_state_pop_points = 15 }
				}
				else_if = {
					limit = { state_population < 1500000 }
					set_variable = { NA_B_state_pop_points = 16 }
				}
				else_if = {
					limit = { state_population < 1750000 }
					set_variable = { NA_B_state_pop_points = 17 }
				}
				else_if = {
					limit = { state_population < 2000000 }
					set_variable = { NA_B_state_pop_points = 18 }
				}
				else_if = {
					limit = { state_population < 2250000 }
					set_variable = { NA_B_state_pop_points = 19 }
				}
				else_if = {
					limit = { state_population < 2500000 }
					set_variable = { NA_B_state_pop_points = 20 }
				}
				else_if = {
					limit = { state_population < 2750000 }
					set_variable = { NA_B_state_pop_points = 21 }
				}
				else_if = {
					limit = { state_population < 3000000 }
					set_variable = { NA_B_state_pop_points = 22 }
				}
				else_if = {
					limit = { state_population < 3500000 }
					set_variable = { NA_B_state_pop_points = 23 }
				}
				else_if = {
					limit = { state_population < 4000000 }
					set_variable = { NA_B_state_pop_points = 24 }
				}
				else_if = {
					limit = { state_population < 4500000 }
					set_variable = { NA_B_state_pop_points = 25 }
				}
				else_if = {
					limit = { state_population < 5000000 }
					set_variable = { NA_B_state_pop_points = 26 }
				}
				else_if = {
					limit = { state_population > 5000000 }
					set_variable = { NA_B_state_pop_points = 27 }
				}
				if = {
					limit = {
						check_variable = { var = NA_B_state_pop_points value = 0 compare = greater_than_or_equals }
						check_variable = { var = NA_B_state_pop_points value = 3 compare = less_than }
					}
					add_to_variable = { NA_B_mantle_of_the_state_points = 1 }
				}
				else_if = {
					limit = {
						check_variable = { var = NA_B_state_pop_points value = 3 compare = equals }
					}
					add_to_variable = { NA_B_mantle_of_the_state_points = 3 }
				}
				else_if = {
					limit = {
						check_variable = { var = NA_B_state_pop_points value = 4 compare = greater_than_or_equals }
						check_variable = { var = NA_B_state_pop_points value = 6 compare = less_than }
					}
					add_to_variable = { NA_B_mantle_of_the_state_points = 4 }
				}
				else_if = {
					limit = { check_variable = { var = NA_B_state_pop_points value = 6 compare = equals } }
					add_to_variable = { NA_B_mantle_of_the_state_points = 6 }
				}
				else_if = {
					limit = { check_variable = { var = NA_B_state_pop_points value = 7 compare = equals } }
					add_to_variable = { NA_B_mantle_of_the_state_points = 8 }
				}
				else_if = {
					limit = { check_variable = { var = NA_B_state_pop_points value = 8 compare = equals } }
					add_to_variable = { NA_B_mantle_of_the_state_points = 10 }
				}
				else_if = {
					limit = { check_variable = { var = NA_B_state_pop_points value = 9 compare = equals } }
					add_to_variable = { NA_B_mantle_of_the_state_points = 12 }
				}
				else_if = {
					limit = { check_variable = { var = NA_B_state_pop_points value = 10 compare = equals } }
					add_to_variable = { NA_B_mantle_of_the_state_points = 14 }
				}
				else_if = {
					limit = { check_variable = { var = NA_B_state_pop_points value = 11 compare = equals } }
					add_to_variable = { NA_B_mantle_of_the_state_points = 18 }
				}
				else_if = {
					limit = { check_variable = { var = NA_B_state_pop_points value = 12 compare = equals } }
					add_to_variable = { NA_B_mantle_of_the_state_points = 22 }
				}
				else_if = {
					limit = { check_variable = { var = NA_B_state_pop_points value = 13 compare = equals } }
					add_to_variable = { NA_B_mantle_of_the_state_points = 26 }
				}
				else_if = {
					limit = { check_variable = { var = NA_B_state_pop_points value = 14 compare = equals } }
					add_to_variable = { NA_B_mantle_of_the_state_points = 30 }
				}
				else_if = {
					limit = { check_variable = { var = NA_B_state_pop_points value = 15 compare = equals } }
					add_to_variable = { NA_B_mantle_of_the_state_points = 35 }
				}
				else_if = {
					limit = { check_variable = { var = NA_B_state_pop_points value = 16 compare = equals } }
					add_to_variable = { NA_B_mantle_of_the_state_points = 40 }
				}
				else_if = {
					limit = { check_variable = { var = NA_B_state_pop_points value = 17 compare = equals } }
					add_to_variable = { NA_B_mantle_of_the_state_points = 45 }
				}
				else_if = {
					limit = { check_variable = { var = NA_B_state_pop_points value = 18 compare = equals } }
					add_to_variable = { NA_B_mantle_of_the_state_points = 50 }
				}
				else_if = {
					limit = { check_variable = { var = NA_B_state_pop_points value = 19 compare = equals } }
					add_to_variable = { NA_B_mantle_of_the_state_points = 55 }
				}
				else_if = {
					limit = { check_variable = { var = NA_B_state_pop_points value = 20 compare = equals } }
					add_to_variable = { NA_B_mantle_of_the_state_points = 60 }
				}
				else_if = {
					limit = { check_variable = { var = NA_B_state_pop_points value = 21 compare = equals } }
					add_to_variable = { NA_B_mantle_of_the_state_points = 65 }
				}
				else_if = {
					limit = { check_variable = { var = NA_B_state_pop_points value = 22 compare = equals } }
					add_to_variable = { NA_B_mantle_of_the_state_points = 70 }
				}
				else_if = {
					limit = { check_variable = { var = NA_B_state_pop_points value = 23 compare = equals } }
					add_to_variable = { NA_B_mantle_of_the_state_points = 80 }
				}
				else_if = {
					limit = { check_variable = { var = NA_B_state_pop_points value = 24 compare = equals } }
					add_to_variable = { NA_B_mantle_of_the_state_points = 90 }
				}
				else_if = {
					limit = { check_variable = { var = NA_B_state_pop_points value = 25 compare = equals } }
					add_to_variable = { NA_B_mantle_of_the_state_points = 100 }
				}
				else_if = {
					limit = { check_variable = { var = NA_B_state_pop_points value = 26 compare = equals } }
					add_to_variable = { NA_B_mantle_of_the_state_points = 110 }
				}
				else_if = {
					limit = { check_variable = { var = NA_B_state_pop_points value = 27 compare = equals } }
					add_to_variable = { NA_B_mantle_of_the_state_points = 150 }
				}
			}
}

NA_B_Add_State_Effect = {
	if = {
		limit = { ROOT = { NA_B_is_american_allowed = yes } }
		add_core_of = ROOT
		every_neighbor_state = {
			limit = {
				has_state_flag = NA_B_Disregardable_State
				NOT = { is_core_of = ROOT }
				OR = {
					is_owned_by = ROOT
					OWNER = { is_subject_of = ROOT }
					OWNER = {  }
				}
			}
			add_core_of = ROOT
		}
		if = {
			limit = { is_owned_by = ROOT }
			add_to_variable = {
				var = usa_congress_senate_total_seats
				value = 2
			}
			add_to_variable = {
				var = usa_congress_house_total_seats
				value = 1
			}
			ROOT = {
				USA_admit_state_add_stars = yes
				USA_check_and_update_stars = yes
				set_temp_variable = { eoanb_prestige_change = 1 }
				eoanb_change_prestige_score = yes
			}
		}
	}
}

# Energy's Buchanan Cabinet

USA_Buchanan_Cabinet_Modify = {
	if = {
		limit = {
			has_country_leader = {
				name = "James Buchanan"
				ruling_only = yes
			}
			USA = {
				has_completed_focus = USA_covode_committee
			}
		}
		country_event = {
			id = usa.267
			days = 1
		}
		if = {
			limit = {
				USA = {
					OR = {
						has_political_power > 225
						# has_political_power = -75
					}
					has_idea = USA_doughface_2_lvl2
				}
			}
			remove_ideas = { USA_doughface_2_lvl2 }
			add_ideas = { USA_doughface_2_lvl1 }
		}
		else_if = {
			limit = {
				USA = {
					OR = {
						has_political_power > 225
						# has_political_power = -75
					}
					has_idea = USA_doughface_2_lvl3
				}
			}
			remove_ideas = { USA_doughface_2_lvl3 }
			add_ideas = { USA_doughface_2_lvl1 }
		}
		else_if = {
			limit = {
				USA = {
					OR = {
						has_political_power > 225
						# has_political_power = -75
					}
					has_idea = USA_doughface_2_lvl4
				}
			}
			remove_ideas = { USA_doughface_2_lvl4 }
			add_ideas = { USA_doughface_2_lvl1 }
		}
		else_if = {
			limit = {
				USA = {
					OR = {
						has_political_power > 225
						# has_political_power = -75
					}
					has_idea = USA_doughface_2_lvl5
				}
			}
			remove_ideas = { USA_doughface_2_lvl5 }
			add_ideas = { USA_doughface_2_lvl1 }
		}
		else_if = {
			limit = {
				USA = {
					OR = {
						has_political_power > 150
						# has_political_power = -150
					}
					has_idea = USA_doughface_2_lvl1
				}
			}
			remove_ideas = { USA_doughface_2_lvl1 }
			add_ideas = { USA_doughface_2_lvl2 }
		}
		else_if = {
			limit = {
				USA = {
					OR = {
						has_political_power > 150
						# has_political_power = -150
					}
					has_idea = USA_doughface_2_lvl3
				}
			}
			remove_ideas = { USA_doughface_2_lvl3 }
			add_ideas = { USA_doughface_2_lvl2 }
		}
		else_if = {
			limit = {
				USA = {
					OR = {
						has_political_power > 150
						# has_political_power = -150
					}
					has_idea = USA_doughface_2_lvl4
				}
			}
			remove_ideas = { USA_doughface_2_lvl4 }
			add_ideas = { USA_doughface_2_lvl2 }
		}
		else_if = {
			limit = {
				USA = {
					OR = {
						has_political_power > 150
						# has_political_power = -150
					}
					has_idea = USA_doughface_2_lvl5
				}
			}
			remove_ideas = { USA_doughface_2_lvl5 }
			add_ideas = { USA_doughface_2_lvl2 }
		}
		else_if = {
			limit = {
				USA = {
					OR = {
						has_political_power > 75
						# has_political_power = -225
					}
					has_idea = USA_doughface_2_lvl1
				}
			}
			remove_ideas = { USA_doughface_2_lvl1 }
			add_ideas = { USA_doughface_2_lvl3 }
		}
		else_if = {
			limit = {
				USA = {
					OR = {
						has_political_power > 75
						# has_political_power = -225
					}
					has_idea = USA_doughface_2_lvl2
				}
			}
			remove_ideas = { USA_doughface_2_lvl2 }
			add_ideas = { USA_doughface_2_lvl3 }
		}
		else_if = {
			limit = {
				USA = {
					OR = {
						has_political_power > 75
						# has_political_power = -225
					}
					has_idea = USA_doughface_2_lvl4
				}
			}
			remove_ideas = { USA_doughface_2_lvl4 }
			add_ideas = { USA_doughface_2_lvl3 }
		}
		else_if = {
			limit = {
				USA = {
					OR = {
						has_political_power > 75
						# has_political_power = -225
					}
					has_idea = USA_doughface_2_lvl5
				}
			}
			remove_ideas = { USA_doughface_2_lvl5 }
			add_ideas = { USA_doughface_2_lvl3 }
		}
		else_if = {
			limit = {
				USA = {
					OR = {
						has_political_power > 0
						# has_political_power = -300
					}
					has_idea = USA_doughface_2_lvl1
				}
			}
			remove_ideas = { USA_doughface_2_lvl1 }
			add_ideas = { USA_doughface_2_lvl4 }
		}
		else_if = {
			limit = {
				USA = {
					OR = {
						has_political_power > 0
						# has_political_power = -300
					}
					has_idea = USA_doughface_2_lvl2
				}
			}
			remove_ideas = { USA_doughface_2_lvl2 }
			add_ideas = { USA_doughface_2_lvl4 }
		}
		else_if = {
			limit = {
				USA = {
					OR = {
						has_political_power > 0
						# has_political_power = -300
					}
					has_idea = USA_doughface_2_lvl3
				}
			}
			remove_ideas = { USA_doughface_2_lvl3 }
			add_ideas = { USA_doughface_2_lvl4 }
		}
		else_if = {
			limit = {
				USA = {
					OR = {
						has_political_power > 0
						# has_political_power = -300
					}
					has_idea = USA_doughface_2_lvl5
				}
			}
			remove_ideas = { USA_doughface_2_lvl5 }
			add_ideas = { USA_doughface_2_lvl4 }
		}
		else_if = {
			limit = {
				USA = {
					has_political_power < 0
					has_idea = USA_doughface_2_lvl1
				}
			}
			remove_ideas = { USA_doughface_2_lvl1 }
			add_ideas = { USA_doughface_2_lvl5 }
		}
		else_if = {
			limit = {
				USA = {
					has_political_power < 0
					has_idea = USA_doughface_2_lvl2
				}
			}
			remove_ideas = { USA_doughface_2_lvl2 }
			add_ideas = { USA_doughface_2_lvl5 }
		}
		else_if = {
			limit = {
				USA = {
					has_political_power < 0
					has_idea = USA_doughface_2_lvl3
				}
			}
			remove_ideas = { USA_doughface_2_lvl3 }
			add_ideas = { USA_doughface_2_lvl5 }
		}
		else_if = {
			limit = {
				USA = {
					has_political_power < 0
					has_idea = USA_doughface_2_lvl4
				}
			}
			remove_ideas = { USA_doughface_2_lvl4 }
			add_ideas = { USA_doughface_2_lvl5 }
		}
	}
	else_if = {
		limit = {
			has_country_leader = {
				name = "James Buchanan"
				ruling_only = yes
			}
			USA = {
				has_completed_focus = USA_doughface_cabinet
			}
		}
		country_event = {
			id = usa.267
			days = 1
		}
		if = {
			limit = {
				USA = {
					OR = {
						has_political_power > 225
						# has_political_power = -75
					}
					has_idea = USA_doughface_1_lvl2
				}
			}
			remove_ideas = { USA_doughface_1_lvl2 }
			add_ideas = { USA_doughface_1_lvl1 }
		}
		else_if = {
			limit = {
				USA = {
					OR = {
						has_political_power > 225
						# has_political_power = -75
					}
					has_idea = USA_doughface_1_lvl3
				}
			}
			remove_ideas = { USA_doughface_1_lvl3 }
			add_ideas = { USA_doughface_1_lvl1 }
		}
		else_if = {
			limit = {
				USA = {
					OR = {
						has_political_power > 225
						# has_political_power = -75
					}
					has_idea = USA_doughface_1_lvl4
				}
			}
			remove_ideas = { USA_doughface_1_lvl4 }
			add_ideas = { USA_doughface_1_lvl1 }
		}
		else_if = {
			limit = {
				USA = {
					OR = {
						has_political_power > 225
						# has_political_power = -75
					}
					has_idea = USA_doughface_1_lvl5
				}
			}
			remove_ideas = { USA_doughface_1_lvl5 }
			add_ideas = { USA_doughface_1_lvl1 }
		}
		else_if = {
			limit = {
				USA = {
					OR = {
						has_political_power > 150
						# has_political_power = -150
					}
					has_idea = USA_doughface_1_lvl1
				}
			}
			remove_ideas = { USA_doughface_1_lvl1 }
			add_ideas = { USA_doughface_1_lvl2 }
		}
		else_if = {
			limit = {
				USA = {
					OR = {
						has_political_power > 150
						# has_political_power = -150
					}
					has_idea = USA_doughface_1_lvl3
				}
			}
			remove_ideas = { USA_doughface_1_lvl3 }
			add_ideas = { USA_doughface_1_lvl2 }
		}
		else_if = {
			limit = {
				USA = {
					OR = {
						has_political_power > 150
						# has_political_power = -150
					}
					has_idea = USA_doughface_1_lvl4
				}
			}
			remove_ideas = { USA_doughface_1_lvl4 }
			add_ideas = { USA_doughface_1_lvl2 }
		}
		else_if = {
			limit = {
				USA = {
					OR = {
						has_political_power > 150
						# has_political_power = -150
					}
					has_idea = USA_doughface_1_lvl5
				}
			}
			remove_ideas = { USA_doughface_1_lvl5 }
			add_ideas = { USA_doughface_1_lvl2 }
		}
		else_if = {
			limit = {
				USA = {
					OR = {
						has_political_power > 75
						# has_political_power = -225
					}
					has_idea = USA_doughface_1_lvl1
				}
			}
			remove_ideas = { USA_doughface_1_lvl1 }
			add_ideas = { USA_doughface_1_lvl3 }
		}
		else_if = {
			limit = {
				USA = {
					OR = {
						has_political_power > 75
						# has_political_power = -225
					}
					has_idea = USA_doughface_1_lvl2
				}
			}
			remove_ideas = { USA_doughface_1_lvl2 }
			add_ideas = { USA_doughface_1_lvl3 }
		}
		else_if = {
			limit = {
				USA = {
					OR = {
						has_political_power > 75
						# has_political_power = -225
					}
					has_idea = USA_doughface_1_lvl4
				}
			}
			remove_ideas = { USA_doughface_1_lvl4 }
			add_ideas = { USA_doughface_1_lvl3 }
		}
		else_if = {
			limit = {
				USA = {
					OR = {
						has_political_power > 75
						# has_political_power = -225
					}
					has_idea = USA_doughface_1_lvl5
				}
			}
			remove_ideas = { USA_doughface_1_lvl5 }
			add_ideas = { USA_doughface_1_lvl3 }
		}
		else_if = {
			limit = {
				USA = {
					OR = {
						has_political_power > 0
						# has_political_power = -300
					}
					has_idea = USA_doughface_1_lvl1
				}
			}
			remove_ideas = { USA_doughface_1_lvl1 }
			add_ideas = { USA_doughface_1_lvl4 }
		}
		else_if = {
			limit = {
				USA = {
					OR = {
						has_political_power > 0
						# has_political_power = -300
					}
					has_idea = USA_doughface_1_lvl2
				}
			}
			remove_ideas = { USA_doughface_1_lvl2 }
			add_ideas = { USA_doughface_1_lvl4 }
		}
		else_if = {
			limit = {
				USA = {
					OR = {
						has_political_power > 0
						# has_political_power = -300
					}
					has_idea = USA_doughface_1_lvl3
				}
			}
			remove_ideas = { USA_doughface_1_lvl3 }
			add_ideas = { USA_doughface_1_lvl4 }
		}
		else_if = {
			limit = {
				USA = {
					OR = {
						has_political_power > 0
						# has_political_power = -300
					}
					has_idea = USA_doughface_1_lvl5
				}
			}
			remove_ideas = { USA_doughface_1_lvl5 }
			add_ideas = { USA_doughface_1_lvl4 }
		}
		else_if = {
			limit = {
				USA = {
					has_political_power < 0
					has_idea = USA_doughface_1_lvl1
				}
			}
			remove_ideas = { USA_doughface_1_lvl1 }
			add_ideas = { USA_doughface_1_lvl5 }
		}
		else_if = {
			limit = {
				USA = {
					has_political_power < 0
					has_idea = USA_doughface_1_lvl2
				}
			}
			remove_ideas = { USA_doughface_1_lvl2 }
			add_ideas = { USA_doughface_1_lvl5 }
		}
		else_if = {
			limit = {
				USA = {
					has_political_power < 0
					has_idea = USA_doughface_1_lvl3
				}
			}
			remove_ideas = { USA_doughface_1_lvl3 }
			add_ideas = { USA_doughface_1_lvl5 }
		}
		else_if = {
			limit = {
				USA = {
					has_political_power < 0
					has_idea = USA_doughface_1_lvl4
				}
			}
			remove_ideas = { USA_doughface_1_lvl4 }
			add_ideas = { USA_doughface_1_lvl5 }
		}
	}
	else_if = {
		limit = {
			has_country_leader = {
				name = "James Buchanan"
				ruling_only = yes
			}
			USA = {
				has_completed_focus = USA_close_ranks
			}
		}
		country_event = {
			id = usa.267
			days = 1
		}
		if = {
			limit = {
				USA = {
					OR = {
						has_political_power > 225
						# has_political_power = -75
					}
					has_idea = USA_inclusive_2_lvl2
				}
			}
			remove_ideas = USA_inclusive_2_lvl2
			add_ideas = USA_inclusive_2_lvl1
		}
		else_if = {
			limit = {
				USA = {
					OR = {
						has_political_power > 225
						# has_political_power = -75
					}
					has_idea = USA_inclusive_2_lvl3
				}
			}
			remove_ideas = USA_inclusive_2_lvl3
			add_ideas = USA_inclusive_2_lvl1
		}
		else_if = {
			limit = {
				USA = {
					OR = {
						has_political_power > 225
						# has_political_power = -75
					}
					has_idea = USA_inclusive_2_lvl4
				}
			}
			remove_ideas = USA_inclusive_2_lvl4
			add_ideas = USA_inclusive_2_lvl1
		}
		else_if = {
			limit = {
				USA = {
					OR = {
						has_political_power > 225
						# has_political_power = -75
					}
					has_idea = USA_inclusive_2_lvl5
				}
			}
			remove_ideas = USA_inclusive_2_lvl5
			add_ideas = USA_inclusive_2_lvl1
		}
		else_if = {
			limit = {
				USA = {
					OR = {
						has_political_power > 150
						# has_political_power = -150
					}
					has_idea = USA_inclusive_2_lvl1
				}
			}
			remove_ideas = USA_inclusive_2_lvl1
			add_ideas = USA_inclusive_2_lvl2
		}
		else_if = {
			limit = {
				USA = {
					OR = {
						has_political_power > 150
						# has_political_power = -150
					}
					has_idea = USA_inclusive_2_lvl3
				}
			}
			remove_ideas = USA_inclusive_2_lvl3
			add_ideas = USA_inclusive_2_lvl2
		}
		else_if = {
			limit = {
				USA = {
					OR = {
						has_political_power > 150
						# has_political_power = -150
					}
					has_idea = USA_inclusive_2_lvl4
				}
			}
			remove_ideas = USA_inclusive_2_lvl4
			add_ideas = USA_inclusive_2_lvl2
		}
		else_if = {
			limit = {
				USA = {
					OR = {
						has_political_power > 150
						# has_political_power = -150
					}
					has_idea = USA_inclusive_2_lvl5
				}
			}
			remove_ideas = USA_inclusive_2_lvl5
			add_ideas = USA_inclusive_2_lvl2
		}
		else_if = {
			limit = {
				USA = {
					OR = {
						has_political_power > 75
						# has_political_power = -225
					}
					has_idea = USA_inclusive_2_lvl1
				}
			}
			remove_ideas = USA_inclusive_2_lvl1
			add_ideas = USA_inclusive_2_lvl3
		}
		else_if = {
			limit = {
				USA = {
					OR = {
						has_political_power > 75
						# has_political_power = -225
					}
					has_idea = USA_inclusive_2_lvl2
				}
			}
			remove_ideas = USA_inclusive_2_lvl2
			add_ideas = USA_inclusive_2_lvl3
		}
		else_if = {
			limit = {
				USA = {
					OR = {
						has_political_power > 75
						# has_political_power = -225
					}
					has_idea = USA_inclusive_2_lvl4
				}
			}
			remove_ideas = USA_inclusive_2_lvl4
			add_ideas = USA_inclusive_2_lvl3
		}
		else_if = {
			limit = {
				USA = {
					OR = {
						has_political_power > 75
						# has_political_power = -225
					}
					has_idea = USA_inclusive_2_lvl5
				}
			}
			remove_ideas = USA_inclusive_2_lvl5
			add_ideas = USA_inclusive_2_lvl3
		}
		else_if = {
			limit = {
				USA = {
					OR = {
						has_political_power > 0
						# has_political_power = -300
					}
					has_idea = USA_inclusive_2_lvl1
				}
			}
			remove_ideas = USA_inclusive_2_lvl1
			add_ideas = USA_inclusive_2_lvl4
		}
		else_if = {
			limit = {
				USA = {
					OR = {
						has_political_power > 0
						# has_political_power = -300
					}
					has_idea = USA_inclusive_2_lvl2
				}
			}
			remove_ideas = USA_inclusive_2_lvl2
			add_ideas = USA_inclusive_2_lvl4
		}
		else_if = {
			limit = {
				USA = {
					OR = {
						has_political_power > 0
						# has_political_power = -300
					}
					has_idea = USA_inclusive_2_lvl3
				}
			}
			remove_ideas = USA_inclusive_2_lvl3
			add_ideas = USA_inclusive_2_lvl4
		}
		else_if = {
			limit = {
				USA = {
					OR = {
						has_political_power > 0
						# has_political_power = -300
					}
					has_idea = USA_inclusive_2_lvl5
				}
			}
			remove_ideas = USA_inclusive_2_lvl5
			add_ideas = USA_inclusive_2_lvl4
		}
		else_if = {
			limit = {
				USA = {
					has_political_power < 0
					has_idea = USA_inclusive_2_lvl1
				}
			}
			remove_ideas = USA_inclusive_2_lvl1
			add_ideas = USA_inclusive_2_lvl5
		}
		else_if = {
			limit = {
				USA = {
					has_political_power < 0
					has_idea = USA_inclusive_2_lvl2
				}
			}
			remove_ideas = USA_inclusive_2_lvl2
			add_ideas = USA_inclusive_2_lvl5
		}
		else_if = {
			limit = {
				USA = {
					has_political_power < 0
					has_idea = USA_inclusive_2_lvl3
				}
			}
			remove_ideas = USA_inclusive_2_lvl3
			add_ideas = USA_inclusive_2_lvl5
		}
		else_if = {
			limit = {
				USA = {
					has_political_power < 0
					has_idea = USA_inclusive_2_lvl4
				}
			}
			remove_ideas = USA_inclusive_2_lvl4
			add_ideas = USA_inclusive_2_lvl5
		}
	}
	else_if = {
		limit = {
			has_country_leader = {
				name = "James Buchanan"
				ruling_only = yes
			}
			USA = {
				has_completed_focus = USA_inclusive_cabinet
			}
		}
		country_event = {
			id = usa.267
			days = 1
		}
		if = {
			limit = {
				USA = {
					OR = {
						has_political_power > 225
						# has_political_power = -75
					}
					has_idea = USA_inclusive_1_lvl2
				}
			}
			remove_ideas = USA_inclusive_1_lvl2
			add_ideas = USA_inclusive_1_lvl1
		}
		else_if = {
			limit = {
				USA = {
					OR = {
						has_political_power > 225
						# has_political_power = -75
					}
					has_idea = USA_inclusive_1_lvl3
				}
			}
			remove_ideas = USA_inclusive_1_lvl3
			add_ideas = USA_inclusive_1_lvl1
		}
		else_if = {
			limit = {
				USA = {
					OR = {
						has_political_power > 225
						# has_political_power = -75
					}
					has_idea = USA_inclusive_1_lvl4
				}
			}
			remove_ideas = USA_inclusive_1_lvl4
			add_ideas = USA_inclusive_1_lvl1
		}
		else_if = {
			limit = {
				USA = {
					OR = {
						has_political_power > 225
						# has_political_power = -75
					}
					has_idea = USA_inclusive_1_lvl5
				}
			}
			remove_ideas = USA_inclusive_1_lvl5
			add_ideas = USA_inclusive_1_lvl1
		}
		else_if = {
			limit = {
				USA = {
					OR = {
						has_political_power > 150
						# has_political_power = -150
					}
					has_idea = USA_inclusive_1_lvl1
				}
			}
			remove_ideas = USA_inclusive_1_lvl1
			add_ideas = USA_inclusive_1_lvl2
		}
		else_if = {
			limit = {
				USA = {
					OR = {
						has_political_power > 150
						# has_political_power = -150
					}
					has_idea = USA_inclusive_1_lvl3
				}
			}
			remove_ideas = USA_inclusive_1_lvl3
			add_ideas = USA_inclusive_1_lvl2
		}
		else_if = {
			limit = {
				USA = {
					OR = {
						has_political_power > 150
						# has_political_power = -150
					}
					has_idea = USA_inclusive_1_lvl4
				}
			}
			remove_ideas = USA_inclusive_1_lvl4
			add_ideas = USA_inclusive_1_lvl2
		}
		else_if = {
			limit = {
				USA = {
					OR = {
						has_political_power > 150
						# has_political_power = -150
					}
					has_idea = USA_inclusive_1_lvl5
				}
			}
			remove_ideas = USA_inclusive_1_lvl5
			add_ideas = USA_inclusive_1_lvl2
		}
		else_if = {
			limit = {
				USA = {
					OR = {
						has_political_power > 75
						# has_political_power = -225
					}
					has_idea = USA_inclusive_1_lvl1
				}
			}
			remove_ideas = USA_inclusive_1_lvl1
			add_ideas = USA_inclusive_1_lvl3
		}
		else_if = {
			limit = {
				USA = {
					OR = {
						has_political_power > 75
						# has_political_power = -225
					}
					has_idea = USA_inclusive_1_lvl2
				}
			}
			remove_ideas = USA_inclusive_1_lvl2
			add_ideas = USA_inclusive_1_lvl3
		}
		else_if = {
			limit = {
				USA = {
					OR = {
						has_political_power > 75
						# has_political_power = -225
					}
					has_idea = USA_inclusive_1_lvl4
				}
			}
			remove_ideas = USA_inclusive_1_lvl4
			add_ideas = USA_inclusive_1_lvl3
		}
		else_if = {
			limit = {
				USA = {
					OR = {
						has_political_power > 75
						# has_political_power = -225
					}
					has_idea = USA_inclusive_1_lvl5
				}
			}
			remove_ideas = USA_inclusive_1_lvl5
			add_ideas = USA_inclusive_1_lvl3
		}
		else_if = {
			limit = {
				USA = {
					OR = {
						has_political_power > 0
						# has_political_power = -300
					}
					has_idea = USA_inclusive_1_lvl1
				}
			}
			remove_ideas = USA_inclusive_1_lvl1
			add_ideas = USA_inclusive_1_lvl4
		}
		else_if = {
			limit = {
				USA = {
					OR = {
						has_political_power > 0
						# has_political_power = -300
					}
					has_idea = USA_inclusive_1_lvl2
				}
			}
			remove_ideas = USA_inclusive_1_lvl2
			add_ideas = USA_inclusive_1_lvl4
		}
		else_if = {
			limit = {
				USA = {
					OR = {
						has_political_power > 0
						# has_political_power = -300
					}
					has_idea = USA_inclusive_1_lvl3
				}
			}
			remove_ideas = USA_inclusive_1_lvl3
			add_ideas = USA_inclusive_1_lvl4
		}
		else_if = {
			limit = {
				USA = {
					OR = {
						has_political_power > 0
						# has_political_power = -300
					}
					has_idea = USA_inclusive_1_lvl5
				}
			}
			remove_ideas = USA_inclusive_1_lvl5
			add_ideas = USA_inclusive_1_lvl4
		}
		else_if = {
			limit = {
				USA = {
					has_political_power < 0
					has_idea = USA_inclusive_1_lvl1
				}
			}
			remove_ideas = USA_inclusive_1_lvl1
			add_ideas = USA_inclusive_1_lvl5
		}
		else_if = {
			limit = {
				USA = {
					has_political_power < 0
					has_idea = USA_inclusive_1_lvl2
				}
			}
			remove_ideas = USA_inclusive_1_lvl2
			add_ideas = USA_inclusive_1_lvl5
		}
		else_if = {
			limit = {
				USA = {
					has_political_power < 0
					has_idea = USA_inclusive_1_lvl3
				}
			}
			remove_ideas = USA_inclusive_1_lvl3
			add_ideas = USA_inclusive_1_lvl5
		}
		else_if = {
			limit = {
				USA = {
					has_political_power < 0
					has_idea = USA_inclusive_1_lvl4
				}
			}
			remove_ideas = USA_inclusive_1_lvl4
			add_ideas = USA_inclusive_1_lvl5
		}
	}
}

######################## Slavery Debate ##########################
USA_Slavery_Debate_setup = {
	set_country_flag = USA_Slavery_Debate_Ongoing
	# State Count
	set_variable = {
		USA_Slavery_Debate_StateS_Count = 15
	}
	set_variable = {
		USA_Slavery_Debate_StateF_Count = 16
	}
	set_variable = {
		USA_Slavery_Debate_StateSD_Count = -1
	}
	set_variable = {
		USA_Slavery_Debate_StateFD_Count = 1
	}
	
	# Leanings Setup
	set_variable = {
		USA_Slavery_Debate_Leaning = 8
	}
	clamp_variable = {
		var = USA_Slavery_Debate_Leaning
		min = -50
		max = 50
	}
	set_temp_variable = {
		USA_Slavery_Debate_Leaning_Change = 0
	}
	USA_Slavery_Debate_Leaning_Modify = yes

	# Tensions Setup
	set_variable = { 
		USA_Slavery_Debate_Tension = 56 
	}
	clamp_variable = {
		var = USA_Slavery_Debate_Tension
		min = 0
		max = 100
	}
	set_temp_variable = {
		USA_Slavery_Debate_Tension_Change = 0
	}
	USA_Slavery_Debate_Tension_Modify = yes
	add_dynamic_modifier = { modifier = USA_Slavery_Debate_Tension_Modifier }
}

USA_Slavery_Debate_StateS_Count_Modify = {
	if = {
		limit = { has_country_flag = USA_Slavery_Debate_Ongoing }
		custom_effect_tooltip = USA_Slavery_Debate_StateS_Count_Modify_tt
		add_to_variable = {
			USA_Slavery_Debate_StateS_Count = 1
		}
		add_to_variable = {
			USA_Slavery_Debate_StateSD_Count = 1
		}
		add_to_variable = {
			USA_Slavery_Debate_StateFD_Count = -1
		}
	}
}

USA_Slavery_Debate_StateS_Count_Modify2 = {
	if = {
		limit = { has_country_flag = USA_Slavery_Debate_Ongoing }
		custom_effect_tooltip = USA_Slavery_Debate_StateS_Count_Modify2_tt
		add_to_variable = {
			USA_Slavery_Debate_StateS_Count = -1
		}
		clamp_variable = {
			var = USA_Slavery_Debate_StateS_Count
			min = 0
		}
		add_to_variable = {
			USA_Slavery_Debate_StateSD_Count = -1
		}
		add_to_variable = {
			USA_Slavery_Debate_StateFD_Count = 1
		}
	}
}

USA_Slavery_Debate_StateF_Count_Modify = {
	if = {
		limit = { has_country_flag = USA_Slavery_Debate_Ongoing }
		custom_effect_tooltip = USA_Slavery_Debate_StateF_Count_Modify_tt
		add_to_variable = {
			USA_Slavery_Debate_StateF_Count = 1
		}
		add_to_variable = {
			USA_Slavery_Debate_StateFD_Count = 1
		}
		add_to_variable = {
			USA_Slavery_Debate_StateSD_Count = -1
		}
	}
}

USA_Slavery_Debate_StateF_Count_Modify2 = {
	if = {
		limit = { has_country_flag = USA_Slavery_Debate_Ongoing }
		custom_effect_tooltip = USA_Slavery_Debate_StateF_Count_Modify2_tt
		add_to_variable = {
			USA_Slavery_Debate_StateF_Count = -1
		}
		clamp_variable = {
			var = USA_Slavery_Debate_StateF_Count
			min = 0
		}
		add_to_variable = {
			USA_Slavery_Debate_StateFD_Count = -1
		}
		add_to_variable = {
			USA_Slavery_Debate_StateSD_Count = 1
		}
	}
}

USA_Slavery_Debate_Leaning_Modify = {
	if = {
		limit = { has_country_flag = USA_Slavery_Debate_Ongoing }
		# Input
		add_to_variable = { 
			USA_Slavery_Debate_Leaning = USA_Slavery_Debate_Leaning_Change 
		}

		clamp_variable = {
			var = USA_Slavery_Debate_Leaning
			min = -50
			max = 50
		}
		set_temp_variable = { USA_Slavery_Debate_Leaning_Change1 = 0 }
	
		subtract_from_temp_variable = { 
			USA_Slavery_Debate_Leaning_Change1 = USA_Slavery_Debate_Leaning_Change 
		}

		if = {
			limit = { 
				check_variable = { USA_Slavery_Debate_Leaning_Change > 0 } 
			}
			custom_effect_tooltip = USA_Slavery_Debate_Rising_Leaning_ChangeS_tt
		}
		else_if = {
			limit = { 
				check_variable = { USA_Slavery_Debate_Leaning_Change < 0 }
			}
			custom_effect_tooltip = USA_Slavery_Debate_Rising_Leaning_ChangeF_tt
		}

		set_variable = { USA_Slavery_Debate_Leaning1 = USA_Slavery_Debate_Leaning }
		multiply_variable = { USA_Slavery_Debate_Leaning1 = -1 }


		# Leanings Drift
		if = {
			limit = { 
				check_variable = { USA_Slavery_Debate_Leaning > 14 }
			}
			set_variable = { USA_Slavery_Debate_driftR = 0.075 }
			set_variable = { USA_Slavery_Debate_driftU = -0.025 }
			set_variable = { USA_Slavery_Debate_driftD = 0.025 }
		}
		else_if = {
			limit = {
				check_variable = { USA_Slavery_Debate_Leaning < -14 }
			}
			set_variable = { USA_Slavery_Debate_driftD = 0.075 }
			set_variable = { USA_Slavery_Debate_driftU = -0.025 }
			set_variable = { USA_Slavery_Debate_driftR = 0.025 }
		}
		else = {
			set_variable = { USA_Slavery_Debate_driftU = 0.04 }
			set_variable = { USA_Slavery_Debate_driftR = -0.025 }
			set_variable = { USA_Slavery_Debate_driftD = -0.025 }
		}
	}
}

USA_Slavery_Debate_Tension_Modify = {
	if = {
		limit = { has_country_flag = USA_Slavery_Debate_Ongoing }
		# Input
		add_to_variable = { 
			USA_Slavery_Debate_Tension = USA_Slavery_Debate_Tension_Change
		}

		clamp_variable = {
			var = USA_Slavery_Debate_Tension
			min = 0
			max = 100
		}

		if = {
			limit = { check_variable = { USA_Slavery_Debate_Tension_Change > 0 } }
			custom_effect_tooltip = USA_Slavery_Debate_Rising_Tensions_ChangeU_tt
		}
		if = {
			limit = { check_variable = { USA_Slavery_Debate_Tension_Change < 0 } }
			set_temp_variable = { USA_Slavery_Debate_Tension_Change1 = 0 }
			subtract_from_temp_variable = { USA_Slavery_Debate_Tension_Change1 = USA_Slavery_Debate_Tension_Change }
			custom_effect_tooltip = USA_Slavery_Debate_Rising_Tensions_ChangeD_tt
		}

		set_temp_variable = {
			USA_Slavery_Debate_ppg_temp = USA_Slavery_Debate_Tension
		}
		multiply_temp_variable = {
			USA_Slavery_Debate_ppg_temp = -0.007
		}
		set_temp_variable = {
			USA_Slavery_Debate_swf_temp = USA_Slavery_Debate_Tension
		}
		multiply_temp_variable = {
			USA_Slavery_Debate_swf_temp = -0.002
		}
		set_temp_variable = {
			USA_Slavery_Debate_aaf_temp = USA_Slavery_Debate_Tension
		}
		multiply_temp_variable = {
			USA_Slavery_Debate_aaf_temp = -0.004
		}

		set_variable = {
			USA_Slavery_Debate_ppg = USA_Slavery_Debate_ppg_temp
		}
		set_variable = {
			USA_Slavery_Debate_swf = USA_Slavery_Debate_swf_temp
		}
		set_variable = {
			USA_Slavery_Debate_aaf = USA_Slavery_Debate_aaf_temp
		}
	
		if = {
			limit = { 
				check_variable = { USA_Slavery_Debate_Tension_Value > 89 } 
			}
			set_variable = { USA_Slavery_Debate_gwt = 0.30 }
			set_variable = { USA_Slavery_Debate_sf = -0.25 }
		}
		else_if = {
			limit = { 
				check_variable = { USA_Slavery_Debate_Tension_Value > 79 }
			}
			set_variable = { USA_Slavery_Debate_gwt = 0.25 }
			set_variable = { USA_Slavery_Debate_sf = -0.225 }
		}
		else_if = {
			limit = { 
				check_variable = { USA_Slavery_Debate_Tension_Value > 69 }
			}
			set_variable = { USA_Slavery_Debate_gwt = 0.20 }
			set_variable = { USA_Slavery_Debate_sf = -0.20 }
		}
		else_if = {
			limit = { 
				check_variable = { USA_Slavery_Debate_Tension_Value > 59 }
			}
			set_variable = { USA_Slavery_Debate_gwt = 0.15 }
			set_variable = { USA_Slavery_Debate_sf = -0.175 }
		}
		else_if = {
			limit = { 
				check_variable = { USA_Slavery_Debate_Tension_Value > 49 }
			}
			set_variable = { USA_Slavery_Debate_gwt = 0.125 }
			set_variable = { USA_Slavery_Debate_sf = -0.15 }
		}
		else_if = {
			limit = { 
				check_variable = { USA_Slavery_Debate_Tension_Value > 39 }
			}
			set_variable = { USA_Slavery_Debate_gwt = 0.10 }
			set_variable = { USA_Slavery_Debate_sf = -0.125 }
		}
		else_if = {
			limit = { 
				check_variable = { USA_Slavery_Debate_Tension_Value > 29 }
			}
			set_variable = { USA_Slavery_Debate_gwt = 0.10 }
			set_variable = { USA_Slavery_Debate_sf = -0.10 }
		}
		else_if = {
			limit = { 
				check_variable = { USA_Slavery_Debate_Tension_Value > 14 }
			}
			set_variable = { USA_Slavery_Debate_gwt = 0.10 }
			set_variable = { USA_Slavery_Debate_sf = -0.075 }
		}
		else = {
			set_variable = { USA_Slavery_Debate_gwt = 0.10 }
			set_variable = { USA_Slavery_Debate_sf = -0.05 }
		}
	}
}

USA_Slavery_Debate_Remove = {
	clear_variable = USA_Slavery_Debate_Leaning
	clear_variable = USA_Slavery_Debate_Leaning1
	clear_variable = USA_Slavery_Debate_Tension
	
	clear_variable = USA_Slavery_Debate_driftR
	clear_variable = USA_Slavery_Debate_driftU
	clear_variable = USA_Slavery_Debate_dirftD

	clear_variable = USA_Slavery_Debate_swf
	clear_variable = USA_Slavery_Debate_aaf
	clear_variable = USA_Slavery_Debate_ppg
	clear_variable = USA_Slavery_Debate_gwt
	clear_variable = USA_Slavery_Debate_sf

	clear_variable = USA_Slavery_Debate_StateS_Count
	clear_variable = USA_Slavery_Debate_StateSD_Count
	clear_variable = USA_Slavery_Debate_StateF_Count
	clear_variable = USA_Slavery_Debate_StateFD_Count

	clr_country_flag = USA_Slavery_Debate_Ongoing
	remove_dynamic_modifier = {
		modifier = USA_Slavery_Debate_Tension_Modifier
	}
}

######################## Civil War ##########################

ACW_Weapons_Count_Get = {
	if = {
		limit = {
			OR = {
				has_global_flag = ACW_American_Civil_War_Start
				has_global_flag = ACW_American_Civil_War
				has_country_flag = USA_Slavery_Debate_Ongoing
				has_country_flag = ACW_golden_imperium
			}
		}
		custom_effect_tooltip = ACW_Weapons_Count_Get_tt
		add_to_variable = { ROOT.acw_weapons_count_left = acw_weapons_count_change }
	}
}
ACW_Weapons_Count_Use = {
	if = {
		limit = {
			OR = {
				has_global_flag = ACW_American_Civil_War_Start
				has_global_flag = ACW_American_Civil_War
				has_country_flag = ACW_golden_imperium
			}
			OR = {
				has_war_with = CSA
				has_war_with = USA
				has_war_with = CAL
				has_war_with = NEG
			}
		}
		custom_effect_tooltip = ACW_Weapons_Count_Use_tt
		subtract_from_variable = { ROOT.acw_weapons_count_left = 1 }
	}
}
ACW_Draft_Count_Get = {
	if = {
		limit = {
			OR = {
				has_global_flag = ACW_American_Civil_War_Start
				has_global_flag = ACW_American_Civil_War
				has_country_flag = USA_Slavery_Debate_Ongoing
				has_country_flag = ACW_golden_imperium
			}
		}
		custom_effect_tooltip = ACW_Draft_Count_Get_tt
		add_to_variable = { ROOT.acw_draft_count_left = acw_draft_count_change }
	}
}
ACW_Draft_Count_Use = {
	if = {
		limit = {
			OR = {
				has_global_flag = ACW_American_Civil_War_Start
				has_global_flag = ACW_American_Civil_War
				has_country_flag = ACW_golden_imperium
			}
			OR = {
				has_war_with = CSA
				has_war_with = USA
				has_war_with = CAL
				has_war_with = NEG
			}
		}
		custom_effect_tooltip = ACW_Draft_Count_Use_tt
		subtract_from_variable = { ROOT.acw_draft_count_left = 1 }
		add_war_support = -0.01
	}
}

#################### Reconstruction Points #######################
USAROD_Reconstruction_Setup = {
	USA = {
		if = {
			limit = { has_global_flag = ACW_American_Civil_War_Happened }
			USAROD_Reconstruction_Zone_Setup = yes
		}
	}
}

USAROD_Reconstruction_Zone_Setup = {
	if = { 
		limit = { CSA = { is_subject_of = USA } }
		# Virginia
		if = {
			limit = {
				OR = {
					CSA = { owns_state = 362 }
					CSA = { owns_state = 746 }
				}
			}
			WVG = {
				if = {
					limit = { CSA = { owns_state = 362 } }
					transfer_state = 362
				}
				if = {
					limit = { CSA = { owns_state = 746 } }
					transfer_state = 746
				}
				USAROD_Reconstruction_Zone_Setup1 = yes
			}
		}
		# Carolina
		if = {
			limit = {
				OR = {
					CSA = { owns_state = 363 }
					CSA = { owns_state = 364 }
				}
			}
			NCA = {
				if = {
					limit = { CSA = { owns_state = 363 } }
					transfer_state = 363
				}
				if = {
					limit = { CSA = { owns_state = 364 } }
					transfer_state = 364
				}
				USAROD_Reconstruction_Zone_Setup1 = yes
			}
		}
		# Georgia
		if = {
			limit = {
				OR = {
					CSA = { owns_state = 365 }
					CSA = { owns_state = 366 }
					CSA = { owns_state = 367 }
					CSA = { owns_state = 315 } #Cuba
					CSA = { owns_state = 1370 } #Cuba
				}
			}
			USG = {
				if = {
					limit = { CSA = { owns_state = 365 } }
					transfer_state = 365
				}
				if = {
					limit = { CSA = { owns_state = 366 } }
					transfer_state = 366
				}
				if = {
					limit = { CSA = { owns_state = 367 } }
					transfer_state = 367
				}
				if = {
					limit = { CSA = { owns_state = 315 } }
					transfer_state = 315
				}
				if = {
					limit = { CSA = { owns_state = 1370 } }
					transfer_state = 1370
				}
				USAROD_Reconstruction_Zone_Setup1 = yes
			}
		}
		if = {
			limit = { country_exists = TEX }
			# Mississippi
			if = {
				limit = {
					OR = {
						CSA = { owns_state = 368 }
						CSA = { owns_state = 370 }
						CSA = { owns_state = 371 }
						CSA = { owns_state = 372 }
					}
				}
				MIS = {
					if = {
						limit = { CSA = { owns_state = 368 } }
						transfer_state = 368
					}
					if = {
						limit = { CSA = { owns_state = 370 } }
						transfer_state = 370
					}
					if = {
						limit = { CSA = { owns_state = 371 } }
						transfer_state = 371
					}
					if = {
						limit = { CSA = { owns_state = 372 } }
						transfer_state = 372
					}
					USAROD_Reconstruction_Zone_Setup1 = yes
				}
			}
			# Missouri
			if = {
				limit = {
					OR = {
						CSA = { owns_state = 373 }
						CSA = { owns_state = 374 }
						CSA = { owns_state = 383 }
					}
				}
				MIS = {
					if = {
						limit = { CSA = { owns_state = 373 } }
						transfer_state = 373
					}
					if = {
						limit = { CSA = { owns_state = 374 } }
						transfer_state = 374
					}
					if = {
						limit = { CSA = { owns_state = 383 } }
						transfer_state = 383
					}
					USAROD_Reconstruction_Zone_Setup1 = yes
				}
			}
		}
		else = {
			# Mississippi
			if = {
				limit = {
					OR = {
						CSA = { owns_state = 368 }
						CSA = { owns_state = 370 }
						CSA = { owns_state = 372 }
					}
				}
				MIS = {
					if = {
						limit = { CSA = { owns_state = 368 } }
						transfer_state = 368
					}
					if = {
						limit = { CSA = { owns_state = 370 } }
						transfer_state = 370
					}
					if = {
						limit = { CSA = { owns_state = 372 } }
						transfer_state = 372
					}
					USAROD_Reconstruction_Zone_Setup1 = yes
				}
			}
			# Missouri
			if = {
				limit = {
					OR = {
						CSA = { owns_state = 373 }
						CSA = { owns_state = 374 }
						CSA = { owns_state = 383 }
					}
				}
				MIS = {
					if = {
						limit = { CSA = { owns_state = 373 } }
						transfer_state = 373
					}
					if = {
						limit = { CSA = { owns_state = 374 } }
						transfer_state = 374
					}
					if = {
						limit = { CSA = { owns_state = 383 } }
						transfer_state = 383
					}
					USAROD_Reconstruction_Zone_Setup1 = yes
				}
			}
			if = {
				limit = {
					OR = {
						CSA = { owns_state = 371 }
						CSA = { owns_state = 375 }
					}
				}
				LOU = {
					if = {
						limit = { CSA = { owns_state = 371 } }
						transfer_state = 371
					}
					if = {
						limit = { CSA = { owns_state = 375 } }
						transfer_state = 375
					}
					USAROD_Reconstruction_Zone_Setup1 = yes
				}
			}
		}
	}
	# New England
	WVG = {
		if = {
			limit = {
				AND = {
					961 = {
						has_state_flag = ACW_free_state_flag
					}
					USA = {
						controls_state = 961
					}
				}
			}
			transfer_state = 961
		}
		if = {
			limit = {
				AND = {
					960 = {
						has_state_flag = ACW_free_state_flag
					}
					USA = {
						controls_state = 960
					}
				}
			}
			transfer_state = 960
		}
		if = {
			limit = {
				AND = {
					959 = {
						has_state_flag = ACW_free_state_flag
					}
					USA = {
						controls_state = 959
					}
				}
			}
			transfer_state = 959
		}
		if = {
			limit = {
				AND = {
					357 = {
						has_state_flag = ACW_free_state_flag
					}
					USA = {
						controls_state = 357
					}
				}
			}
			transfer_state = 357
		}
		if = {
			limit = {
				AND = {
					1031 = {
						has_state_flag = ACW_free_state_flag
					}
					USA = {
						controls_state = 1031
					}
				}
			}
			transfer_state = 1031
		}
		if = {
			limit = {
				AND = {
					958 = {
						has_state_flag = ACW_free_state_flag
					}
					USA = {
						controls_state = 958
					}
				}
			}
			transfer_state = 958
		}
		USAROD_Reconstruction_Zone_Setup1 = yes
	}
	# Mid-Atlantic
	MIS = {
		if = {
			limit = {
				AND = {
					659 = {
						has_state_flag = ACW_free_state_flag
					}
					USA = {
						controls_state = 659
					}
				}
			}
			transfer_state = 659
		}
		if = {
			limit = {
				AND = {
					359 = {
						has_state_flag = ACW_free_state_flag
					}
					USA = {
						controls_state = 359
					}
				}
			}
			transfer_state = 359
		}
		if = {
			limit = {
				AND = {
					358 = {
						has_state_flag = ACW_free_state_flag
					}
					USA = {
						controls_state = 358
					}
				}
			}
			transfer_state = 358
		}
		if = {
			limit = {
				AND = {
					360 = {
						has_state_flag = ACW_free_state_flag
					}
					USA = {
						controls_state = 360
					}
				}
			}
			transfer_state = 360
		}
		if = {
			limit = {
				AND = {
					360 = {
						has_state_flag = ACW_free_state_flag
					}
					USA = {
						controls_state = 360
					}
				}
			}
			transfer_state = 360
		}
		USAROD_Reconstruction_Zone_Setup1 = yes
	}
	# Eastern Great Lakes
	USG = {
		if = {
			limit = {
				AND = {
					261 = {
						has_state_flag = ACW_free_state_flag
					}
					USA = {
						controls_state = 261
					}
				}
			}
			transfer_state = 261
		}
		if = {
			limit = {
				AND = {
					393 = {
						has_state_flag = ACW_free_state_flag
					}
					USA = {
						controls_state = 393
					}
				}
			}
			transfer_state = 393
		}
		if = {
			limit = {
				AND = {
					396 = {
						has_state_flag = ACW_free_state_flag
					}
					USA = {
						controls_state = 396
					}
				}
			}
			transfer_state = 396
		}
		USAROD_Reconstruction_Zone_Setup1 = yes
	}
	# Western Great Lakes
	LOU = {
		if = {
			limit = {
				AND = {
					1358 = {
						has_state_flag = ACW_free_state_flag
					}
					USA = {
						controls_state = 1358
					}
				}
			}
			transfer_state = 1358
		}
		if = {
			limit = {
				AND = {
					394 = {
						has_state_flag = ACW_free_state_flag
					}
					USA = {
						controls_state = 394
					}
				}
			}
			transfer_state = 394
		}
		if = {
			limit = {
				AND = {
					395 = {
						has_state_flag = ACW_free_state_flag
					}
					USA = {
						controls_state = 395
					}
				}
			}
			transfer_state = 395
		}
		USAROD_Reconstruction_Zone_Setup1 = yes
	}
	# Upper Mississipppi
	LOU = {
		if = {
			limit = {
				AND = {
					391 = {
						has_state_flag = ACW_free_state_flag
					}
					USA = {
						controls_state = 391
					}
				}
			}
			transfer_state = 391
		}
		if = {
			limit = {
				AND = {
					392 = {
						has_state_flag = ACW_free_state_flag
					}
					USA = {
						controls_state = 392
					}
				}
			}
			transfer_state = 392
		}
		USAROD_Reconstruction_Zone_Setup1 = yes
	}
	# Kansas-Nebraska
	KNS = {
		if = {
			limit = {
				AND = {
					384 = {
						has_state_flag = ACW_free_state_flag
					}
					USA = {
						controls_state = 384
					}
				}
			}
			transfer_state = 384
		}
		if = {
			limit = {
				AND = {
					1052 = {
						has_state_flag = ACW_free_state_flag
					}
					USA = {
						controls_state = 1052
					}
				}
			}
			transfer_state = 1052
		}
		if = {
			limit = {
				AND = {
					1296 = {
						has_state_flag = ACW_free_state_flag
					}
					USA = {
						controls_state = 1296
					}
				}
			}
			transfer_state = 1296
		}
		if = {
			limit = {
				AND = {
					383 = {
						has_state_flag = ACW_free_state_flag
					}
					USA = {
						controls_state = 383
					}
				}
			}
			transfer_state = 383
		}
		USAROD_Reconstruction_Zone_Setup1 = yes
	}
	if = {
		limit = { CAL = { is_subject_of = USA } }
		# California
	}
	if = {
		limit = { UTA = { is_subject_of = USA } }
		# Utah
	}
}

USAROD_Reconstruction_Zone_Setup1 = {
	# National Setup
	USA = {
		set_autonomy = {
			target = PREV
			autonomous_state = autonomy_unintegrated_seceded_state
		}
	}
	set_country_flag = USA_unintegrated_seceded_state_country_flag
	load_focus_tree = usa_reconstruction_occupation
	inherit_technology = USA

	# Cosmetics
	if = {
		limit = { NOT = { any_country = { has_cosmetic_tag = USA_unintegrated_seceded_zone_1 } } }
		set_cosmetic_tag = USA_unintegrated_seceded_zone_1
		if = {
			limit = {
				has_global_flag = ACW_Confederate_States_Rebelled
			}
			create_country_leader = {
				name = "John McAllister Schofield"
				desc = ""
				picture = "gfx/leaders/USA/Portrait_USA_Oliver_O_Howard.dds"
				expire = "1900.7.1"
				ideology = military_goverment 
				traits = {}
			}
		}
		else_if = {
			limit = {
				has_global_flag = ACW_Free_States_Rebelled
			}
			create_country_leader = {
				name = "Robert E. Lee"
				desc = ""
				picture = "gfx/leaders/USA/Portrait_USA_Robert_Lee.dds"
				expire = "1900.7.1"
				ideology = military_goverment 
				traits = {}
			}
		}
	}
	else_if = {
		limit = { NOT = { any_country = { has_cosmetic_tag = USA_unintegrated_seceded_zone_2 } } }
		set_cosmetic_tag = USA_unintegrated_seceded_zone_2
		if = {
			limit = {
				has_global_flag = ACW_Confederate_States_Rebelled
			}
			create_country_leader = {
				name = "Daniel Edgar Sickles"
				desc = ""
				picture = "gfx/leaders/USA/Portrait_USA_Daniel_Edgar_Sickles.dds"
				expire = "1900.7.1"
				ideology = military_goverment
				traits = {}
			}
		}
		else_if = {
			limit = {
				has_global_flag = ACW_Free_States_Rebelled
			}
			create_country_leader = {
				name = "George B. McClellan"
				desc = ""
				picture = "gfx/leaders/USA/Portrait_USA_George_McClellan.dds"
				expire = "1900.1.1"
				ideology = military_goverment
				traits = {}
			}
		}
	}
	else_if = {
		limit = { NOT = { any_country = { has_cosmetic_tag = USA_unintegrated_seceded_zone_3 } } }
		set_cosmetic_tag = USA_unintegrated_seceded_zone_3
		if = {
			limit = {
				has_global_flag = ACW_Confederate_States_Rebelled
			}
			create_country_leader = {
				name = "George Gordan Meade"
				desc = ""
				picture = "gfx/leaders/USA/Portrait_USA_George_Meade.dds"
				expire = "1900.7.1"
				ideology = military_goverment
				traits = {}
			}
		}
		else_if = {
			limit = {
				has_global_flag = ACW_Free_States_Rebelled
			}
			create_country_leader = {
				name = "Nathan Bedford Forrest"
				desc = ""
				picture = "gfx/leaders/USA/Portrait_CSA_Nathan_Bedford_Forrest.dds"
				expire = "1900.7.1"
				ideology = military_goverment
				traits = {}
			}
		}
	}
	else_if = {
		limit = { NOT = { any_country = { has_cosmetic_tag = USA_unintegrated_seceded_zone_4 } } }
		set_cosmetic_tag = USA_unintegrated_seceded_zone_4
		if = {
			limit = {
				has_global_flag = ACW_Confederate_States_Rebelled
			}
			create_country_leader = {
				name = "Edward Ord"
				desc = ""
				picture = "gfx/leaders/USA/Portrait_USA_Edward_Ord.dds"
				expire = "1900.7.1"
				ideology = military_goverment
				traits = {}
			}
		}
		else_if = {
			limit = {
				has_global_flag = ACW_Free_States_Rebelled
			}
			create_country_leader = {
				name = "P.T. Beauregard"
				desc = ""
				picture = "gfx/leaders/USA/Portrait_CSA_PGT_Beauregard.dds"
				expire = "1900.7.1"
				ideology = military_goverment
				traits = {}
			}
		}
	}
	else_if = {
		limit = { NOT = { any_country = { has_cosmetic_tag = USA_unintegrated_seceded_zone_5 } } }
		set_cosmetic_tag = USA_unintegrated_seceded_zone_5
		if = {
			limit = {
				has_global_flag = ACW_Confederate_States_Rebelled
			}
			create_country_leader = {
				name = "Philip Sheridan"
				desc = ""
				picture = "gfx/leaders/USA/Portrait_USA_Philip_Sheridan.dds"
				expire = "1900.7.1"
				ideology = military_goverment
				traits = {}
			}
		}
		else_if = {
			limit = {
				has_global_flag = ACW_Free_States_Rebelled
			}
			create_country_leader = {
				name = "Albert Sidney Johnson"
				desc = ""
				picture = "gfx/leaders/USA/Portrait_CSA_Albert_Johnson.dds"
				expire = "1900.7.1"
				ideology = military_goverment
				traits = {}
			}
		}
	}
	else_if = {
		limit = { NOT = { any_country = { has_cosmetic_tag = USA_unintegrated_seceded_zone_6 } } }
		set_cosmetic_tag = USA_unintegrated_seceded_zone_6
		if = {
			limit = {
				has_global_flag = ACW_Confederate_States_Rebelled
			}
			create_country_leader = {
				name = "George B. McClellan"
				desc = ""
				picture = "gfx/leaders/USA/Portrait_USA_George_McClellan.dds"
				expire = "1900.1.1"
				ideology = military_goverment
				traits = {}
			}
		}
		else_if = {
			limit = {
				has_global_flag = ACW_Free_States_Rebelled
			}
			create_country_leader = {
				name = "Joseph E. Jonston"
				desc = ""
				picture = "gfx/leaders/USA/Portrait_CSA_Joseph_Jonston.dds"
				expire = "1900.7.1"
				ideology = military_goverment
				traits = {}
			}
		}
	}
	else_if = {
		limit = { NOT = { any_country = { has_cosmetic_tag = USA_unintegrated_seceded_zone_7 } } }
		set_cosmetic_tag = USA_unintegrated_seceded_zone_7
		if = {
			limit = {
				has_global_flag = ACW_Confederate_States_Rebelled
			}
			create_country_leader = {
				name = "William T. Sherman"
				desc = ""
				picture = "gfx/leaders/USA/Portrait_USA_William_Sherman.dds"
				expire = "1900.7.1"
				ideology = military_goverment
				traits = {}
			}
		}
		else_if = {
			limit = {
				has_global_flag = ACW_Free_States_Rebelled
			}
			create_country_leader = {
				name = "Edmund Kirby"
				desc = ""
				picture = "gfx/leaders/USA/Portrait_CSA_Edmund_Kirby.dds"
				expire = "1900.7.1"
				ideology = military_goverment
				traits = {}
			}
		}
	}
	else_if = {
		limit = { NOT = { any_country = { has_cosmetic_tag = USA_unintegrated_seceded_zone_8 } } }
		set_cosmetic_tag = USA_unintegrated_seceded_zone_8
		if = {
			limit = {
				has_global_flag = ACW_Confederate_States_Rebelled
			}
			create_country_leader = {
				name = "Irvin McDowell"
				desc = ""
				picture = "gfx/leaders/USA/Portrait_USA_Irvin_McDowell.dds"
				expire = "1900.7.1"
				ideology = military_goverment
				traits = {}
			}
		}
		else_if = {
			limit = {
				has_global_flag = ACW_Free_States_Rebelled
			}
			create_country_leader = {
				name = "Leonidas Polk"
				desc = ""
				picture = "gfx/leaders/USA/Portrait_CSA_Leonidas_Polk.dds"
				expire = "1900.7.1"
				ideology = military_goverment
				traits = {}
			}
		}
	}
	else = {
		set_cosmetic_tag = USA_unintegrated_seceded_zone_9
		if = {
			limit = {
				has_global_flag = ACW_Confederate_States_Rebelled
			}
			create_country_leader = {
				name = "Henry Halleck"
				desc = ""
				picture = "gfx/leaders/USA/Portrait_USA_Henry_Halleck.dds"
				expire = "1900.7.1"
				ideology = military_goverment
				traits = {}
			}
		}
		else_if = {
			limit = {
				has_global_flag = ACW_Free_States_Rebelled
			}
			create_country_leader = {
				name = "George H. Thomas"
				desc = ""
				picture = "gfx/leaders/USA/Portrait_USA_George_H_Thomas.dds"
				expire = "1900.7.1"
				ideology = military_goverment
				traits = {}
			}
		}
	}

	# Politics
	set_politics = {
		ruling_party = radical_democracy
		elections_allowed = no
	}
	set_popularities = {
		radical_democracy = 100
	}
	set_party_name = {
		ideology = radical_democracy
		name = USAROD_military_party
		long_name = USAROD_Military_party_long
	}

	# Ideas
	add_ideas = USAROD_occupation
	if = {
		limit = {
			has_idea = usa_slavery_law
		}
		swap_ideas = {
			remove_idea = usa_slavery_law
			add_idea = racial_laws
		}
	}
	if = {
		limit = {
			has_idea = army_spending_level_2
		}
		swap_ideas = {
			remove_idea = army_spending_level_2
			add_idea = army_spending_level_4
		}
	}
	if = {
		limit = {
			has_idea = free_press
		}
		swap_ideas = {
			remove_idea = free_press
			add_idea = censored_press
		}
	}

	# Variable Setup
	every_owned_state = {
		USAROD_Reconstruction_Progress_Setup = yes
		if = {
			limit = { 
				state_population > 100000 
			}
			USAROD_kuklux_progress_plus_1 = yes
		}
	}
}

USAROD_Reconstruction_Progress_Setup = {
	if = {
		limit = { NOT = { has_state_flag = NA_B_Disregardable_State } }
		randomize_temp_variable = {
			var = starting_progress
			distribution = uniform
			min = 0
			max = 12
		}
		round_temp_variable = starting_progress
		divide_temp_variable = { starting_progress = 100 }
		set_variable = {
			var = reconstruction_integration_progress
			value = starting_progress
		}
		#USAROD_reconstruction_progress_random = yes
	}
}

USAROD_reconstruction_progress_random = {
	if = {
		limit = {
			has_variable = reconstruction_integration_progress
		}
		if = {
			limit = {
				OWNER = {
					is_ai = no
					OVERLORD = { is_ai = yes }
				}
			}
			if = {
				limit = { NOT = { has_state_flag = USAROD_constitution_signed } }
				random_list = {
					20 = { OWNER = { state_event = acw_reconstruction.1 } }
					5 = { OWNER = { state_event = acw_reconstruction.2 } }
					5 = { OWNER = { state_event = acw_reconstruction.3 } }
					5 = { OWNER = { state_event = acw_reconstruction.4 } }
					5 = { OWNER = { state_event = acw_reconstruction.5 } }
					5 = { OWNER = { state_event = acw_reconstruction.6 } }
					5 = { OWNER = { state_event = acw_reconstruction.7 } }
					5 = { OWNER = { state_event = acw_reconstruction.8 } }
					5 = { OWNER = { state_event = acw_reconstruction.9 } }
					3 = { OWNER = { state_event = acw_reconstruction.10 } }
					3 = { OWNER = { state_event = acw_reconstruction.11 } }
					3 = { OWNER =  { state_event = acw_reconstruction.12 } }
					3 = { OWNER = { state_event = acw_reconstruction.13 } }
					1 = { OWNER = { state_event = acw_reconstruction.14 } }
				}
			}
			else = {
				random_list = {
					5 = { OWNER = { state_event = acw_reconstruction.2 } }
					5 = { OWNER = { state_event = acw_reconstruction.3 } }
					5 = { OWNER = { state_event = acw_reconstruction.4 } }
					5 = { OWNER = { state_event = acw_reconstruction.5 } }
					5 = { OWNER = { state_event = acw_reconstruction.6 } }
					5 = { OWNER = { state_event = acw_reconstruction.7 } }
					5 = { OWNER = { state_event = acw_reconstruction.8 } }
					5 = { OWNER = { state_event = acw_reconstruction.9 } }
					3 = { OWNER = { state_event = acw_reconstruction.10 } }
					3 = { OWNER = { state_event = acw_reconstruction.11 } }
					3 = { OWNER =  { state_event = acw_reconstruction.12 } }
					3 = { OWNER = { state_event = acw_reconstruction.13 } }
					1 = { OWNER = { state_event = acw_reconstruction.14 } }
				}
			}
		}
		else = {
			if = {
				limit = { NOT = { has_state_flag = USAROD_constitution_signed } }
				random_list = {
					20 = { OWNER = { OVERLORD = { state_event = acw_reconstruction.1 } } }
					5 = { OWNER = { OVERLORD = { state_event = acw_reconstruction.2 } } }
					5 = { OWNER = { OVERLORD = { state_event = acw_reconstruction.3 } } }
					5 = { OWNER = { OVERLORD = { state_event = acw_reconstruction.4 } } }
					5 = { OWNER = { OVERLORD = { state_event = acw_reconstruction.5 } } }
					5 = { OWNER = { OVERLORD = { state_event = acw_reconstruction.6 } } }
					5 = { OWNER = { OVERLORD = { state_event = acw_reconstruction.7 } } }
					5 = { OWNER = { OVERLORD = { state_event = acw_reconstruction.8 } } }
					5 = { OWNER = { OVERLORD = { state_event = acw_reconstruction.9 } } }
					3 = { OWNER = { OVERLORD = { state_event = acw_reconstruction.10 } } }
					3 = { OWNER = { OVERLORD = { state_event = acw_reconstruction.11 } } }
					3 = { OWNER = { OVERLORD = { state_event = acw_reconstruction.12 } } }
					3 = { OWNER = { OVERLORD = { state_event = acw_reconstruction.13 } } }
					1 = { OWNER = { OVERLORD = { state_event = acw_reconstruction.14 } } }
				}
			}
			else = {
				random_list = {
					5 = { OWNER = { OVERLORD = { state_event = acw_reconstruction.2 } } }
					5 = { OWNER = { OVERLORD = { state_event = acw_reconstruction.3 } } }
					5 = { OWNER = { OVERLORD = { state_event = acw_reconstruction.4 } } }
					5 = { OWNER = { OVERLORD = { state_event = acw_reconstruction.5 } } }
					5 = { OWNER = { OVERLORD = { state_event = acw_reconstruction.6 } } }
					5 = { OWNER = { OVERLORD = { state_event = acw_reconstruction.7 } } }
					5 = { OWNER = { OVERLORD = { state_event = acw_reconstruction.8 } } }
					5 = { OWNER = { OVERLORD = { state_event = acw_reconstruction.9 } } }
					3 = { OWNER = { OVERLORD = { state_event = acw_reconstruction.10 } } }
					3 = { OWNER = { OVERLORD = { state_event = acw_reconstruction.11 } } }
					3 = { OWNER = { OVERLORD = { state_event = acw_reconstruction.12 } } }
					3 = { OWNER = { OVERLORD = { state_event = acw_reconstruction.13 } } }
					1 = { OWNER = { OVERLORD = { state_event = acw_reconstruction.14 } } }
				}
			}
		}
	}
	else = {
		# Endpoint. State is ready for annexation
	}
}

USAROD_reconstruction_progress_admit = {
	custom_effect_tooltip = 20_ACW_RECON_DEC_tt
	hidden_effect = {
		clear_variable = reconstruction_integration_progress
		clr_state_flag = USAROD_constitution_signed
		# California
		if = {
			limit = { state = 1343 }
			if = {
				limit = { OWNER = { owns_state = 378 } }
				ROOT = {
					transfer_state = 378
					remove_state_claim = 378
					add_state_core = 378
				}
			}
			if = {
				limit = { OWNER = { owns_state = 1342 } }
				ROOT = {
					transfer_state = 1342
					remove_state_claim = 1342
					add_state_core = 1342
				}
			}
		}
		# Cuba
		if = {
			limit = { state = 315 }
			if = {
				limit = {
					OWNER = { owns_state = 1022 }
				}
				ROOT = {
					transfer_state = 1022
					remove_state_claim = 1022
					add_state_core = 1022
				}
			}
		}
		# Florida
		if = {
			limit = { state = 366 }
		}
		# Kansas
		if = {
			limit = { state = 383 }
			if = {
				limit = { OWNER = { owns_state = 1052 } }
				ROOT = {
					transfer_state = 1052
					remove_state_claim = 1052
					add_state_core = 1052
				}
			}
			if = {
				limit = { OWNER = { owns_state = 1296 } }
				ROOT = {
					transfer_state = 1296
					remove_state_claim = 1296
					add_state_core = 1296
				}
			}
		}
		# Oklahoma
		if = {
			limit = { state = 373 }
			if = {
				limit = { OWNER = { owns_state = 1293 } }
				ROOT = {
					transfer_state = 1293
					remove_state_claim = 1293
					add_state_core = 1293
				}
			}
		}
		# Virginia
		if = {
			limit = { state = 362 }
			if = {
				limit = { OWNER = { owns_state = 746} }
				ROOT = {
					transfer_state = 746
					remove_state_claim = 746
					add_state_core = 746
				}
			}
		}
		# Texas
		if = {
			limit = { state = 375 }
			if = {
				limit = { OWNER = { owns_state = 1280 } }
				ROOT = {
					transfer_state = 1280
					remove_state_claim = 1280
					add_state_core = 1280
				}
			}
		}
		ROOT = {
			transfer_state = PREV
			remove_state_claim = PREV
			add_state_core = PREV
		}

	}
}

USAROD_reconstruction_progress_minus_3 = {
	if = {
		limit = { has_variable = reconstruction_integration_progress }
		custom_effect_tooltip = USAROD_reconstruction_progress_minus_3_tt
		subtract_from_variable = {
			var = THIS.reconstruction_integration_progress
			value = 0.03
		}
		if = {
			limit = {
				check_variable = {
					var = THIS.reconstruction_integration_progress
					value = 0
					compare = less_than_or_equals
				}
			}
			if = {
				limit = { is_core_of = NEG }
				USAROD_radabolition_progress_plus_2 = yes
			}
			else_if = {
				limit = { is_core_of = CAL }
				USAROD_nortonrevival_progress_plus_2 = yes
				USAROD_radabolition_progress_plus_1 = yes
			}
			else_if = {
				limit = { is_core_of = CSA }
				USAROD_kuklux_progress_plus_2 = yes
			}
		}
		clamp_variable = {
			var = THIS.reconstruction_integration_progress
			min = -0.1
			max = 1
		}
	}
}

USAROD_reconstruction_progress_minus_2 = {
	if = {
		limit = { has_variable = reconstruction_integration_progress }
		custom_effect_tooltip = USAROD_reconstruction_progress_minus_2_tt
		subtract_from_variable = {
			var = THIS.reconstruction_integration_progress
			value = 0.02
		}
		if = {
			limit = {
				check_variable = {
					var = THIS.reconstruction_integration_progress
					value = 0
					compare = less_than_or_equals
				}
			}
			if = {
				limit = { is_core_of = NEG }
				USAROD_radabolition_progress_plus_2 = yes
			}
			else_if = {
				limit = { is_core_of = CAL }
				USAROD_nortonrevival_progress_plus_2 = yes
				USAROD_radabolition_progress_plus_1 = yes
			}
			else_if = {
				limit = { is_core_of = CSA }
				USAROD_kuklux_progress_plus_2 = yes
			}
		}
		clamp_variable = {
			var = THIS.reconstruction_integration_progress
			min = -0.1
			max = 1
		}
	}
}

USAROD_reconstruction_progress_minus_1 = {
	if = {
		limit = { has_variable = reconstruction_integration_progress }
		custom_effect_tooltip = USAROD_reconstruction_progress_minus_1_tt
		subtract_from_variable = {
			var = THIS.reconstruction_integration_progress
			value = 0.01
		}
		if = {
			limit = {
				check_variable = {
					var = THIS.reconstruction_integration_progress
					value = 0
					compare = less_than_or_equals
				}
			}
			if = {
				limit = { is_core_of = NEG }
				USAROD_radabolition_progress_plus_2 = yes
			}
			else_if = {
				limit = { is_core_of = CAL }
				USAROD_nortonrevival_progress_plus_2 = yes
				USAROD_radabolition_progress_plus_1 = yes
			}
			else_if = {
				limit = { is_core_of = CSA }
				USAROD_kuklux_progress_plus_2 = yes
			}
		}
		clamp_variable = {
			var = THIS.reconstruction_integration_progress
			min = -0.1
			max = 1
		}
	}
}

USAROD_reconstruction_progress_plus_1 = {
	if = {
		limit = { has_variable = reconstruction_integration_progress }
		custom_effect_tooltip = USAROD_reconstruction_progress_plus_1_tt
		add_to_variable = {
			var = THIS.reconstruction_integration_progress
			value = 0.01
		}
		clamp_variable = {
			var = THIS.reconstruction_integration_progress
			min = -0.1
			max = 1
		}
	}
}

USAROD_reconstruction_progress_plus_2 = {
	if = {
		limit = { has_variable = reconstruction_integration_progress }
		custom_effect_tooltip = USAROD_reconstruction_progress_plus_2_tt
		add_to_variable = {
			var = THIS.reconstruction_integration_progress
			value = 0.02
		}
		clamp_variable = {
			var = THIS.reconstruction_integration_progress
			min = -0.1
			max = 1
		}
	}
}

USAROD_reconstruction_progress_plus_3 = {
	if = {
		limit = { has_variable = reconstruction_integration_progress }
		custom_effect_tooltip = USAROD_reconstruction_progress_plus_3_tt
		add_to_variable = {
			var = THIS.reconstruction_integration_progress
			value = 0.03
		}
		clamp_variable = {
			var = THIS.reconstruction_integration_progress
			min = -0.1
			max = 1
		}
	}
}

USAROD_reconstruction_progress_plus_5 = {
	if = {
		limit = { has_variable = reconstruction_integration_progress }
		custom_effect_tooltip = USAROD_reconstruction_progress_plus_5_tt
		add_to_variable = {
			var = THIS.reconstruction_integration_progress
			value = 0.05
		}
		clamp_variable = {
			var = THIS.reconstruction_integration_progress
			min = -0.1
			max = 1
		}
	}
}

USAROD_reconstruction_progress_plus_10 = {
	if = {
		limit = { has_variable = reconstruction_integration_progress }
		custom_effect_tooltip = USAROD_reconstruction_progress_plus_10_tt
		add_to_variable = {
			var = THIS.reconstruction_integration_progress
			value = 0.1
		}
		clamp_variable = {
			var = THIS.reconstruction_integration_progress
			min = -0.1
			max = 1
		}
	}
}

USAROD_reconstruction_progress_plus_20 = {
	if = {
		limit = { has_variable = reconstruction_integration_progress }
		custom_effect_tooltip = USAROD_reconstruction_progress_plus_20_tt
		add_to_variable = {
			var = THIS.reconstruction_integration_progress
			value = 0.2
		}
		clamp_variable = {
			var = THIS.reconstruction_integration_progress
			min = -0.1
			max = 1
		}
	}
}

USAROD_kuklux_progress_plus_1 = {
	custom_effect_tooltip = USAROD_kuklux_progress_plus_1_tt
	hidden_effect = {
		UCT = {
			add_to_variable = {
				var = forming_kuklux_progress
				value = 0.01
			}
		}
	}
}

USAROD_kuklux_progress_plus_2 = {
	custom_effect_tooltip = USAROD_kuklux_progress_plus_2_tt
	hidden_effect = {
		UCT = {
			add_to_variable = {
				var = forming_kuklux_progress
				value = 0.02
			}
		}
	}
}

USAROD_radabolition_progress_plus_1 = {
	custom_effect_tooltip = USAROD_radabolition_progress_plus_1_tt
	hidden_effect = {
		UCT = {
			add_to_variable = {
				var = forming_radabolition_progress
				value = 0.01
			}
		}
	}
}

USAROD_radabolition_progress_plus_2 = {
	custom_effect_tooltip = USAROD_radabolition_progress_plus_2_tt
	hidden_effect = {
		UCT = {
			add_to_variable = {
				var = forming_radabolition_progress
				value = 0.02
			}
		}
	}
}

USAROD_nortonrevival_progress_plus_1 = {
	custom_effect_tooltip = USAROD_nortonrevival_progress_plus_1_tt
	hidden_effect = {
		UCT = {
			add_to_variable = {
				var = forming_nortonrevival_progress
				value = 0.01
			}
		}
	}
}

USAROD_nortonrevival_progress_plus_2 = {
	custom_effect_tooltip = USAROD_radabolition_progress_plus_2_tt
	hidden_effect = {
		UCT = {
			add_to_variable = {
				var = forming_nortonrevival_progress
				value = 0.02
			}
		}
	}
}

# Politics
USA_Politics_Candidates_Setup = {
	# Presidents
	add_to_array = { 
		array = USA_Presidents_Array
		value = 4
	}
}