###DEBUG STUFF

debug_decisions = {
JAP_Danne_debugging = {
		priority = 999
		allowed = {
			always = yes
		}

		visible = {
			is_debug = yes
			original_tag = JAP
		}
		complete_effect = {
			remove_ideas = JAP_militarism
			remove_ideas = MTG_naval_treaty_adherent
		}
	}
	JAP_Danne_imperial_influence_debugging = {
		priority = 999
		allowed = {
			always = yes
		}

		visible = {
			is_debug = yes
			has_dynamic_modifier = { modifier = JAP_imperial_influence_dm }
		}
		complete_effect = {
			JAP_small_naval_gain_and_small_army_loss = yes
		}
	}
	#ARMY
	JAP_Danne_small_army_faction_increase_debugging = {
		priority = 999
		icon = generic_military
		allowed = {
			always = yes
		}

		visible = {
			is_debug = yes
			has_dynamic_modifier = { modifier = JAP_imperial_influence_dm }
		}
		complete_effect = {
			JAP_small_army_faction_gain = yes
		}
	}
	JAP_Danne_big_army_faction_increase_debugging = {
		priority = 999
		icon = generic_military
		allowed = {
			always = yes
		}

		visible = {
			is_debug = yes
			has_dynamic_modifier = { modifier = JAP_imperial_influence_dm }
		}
		complete_effect = {
			JAP_big_army_faction_gain = yes
		}
	}

	JAP_Danne_small_army_faction_decrease_debugging = {
		priority = 999
		icon = generic_military
		allowed = {
			always = yes
		}

		visible = {
			is_debug = yes
			has_dynamic_modifier = { modifier = JAP_imperial_influence_dm }
		}
		complete_effect = {
			JAP_small_army_faction_loss = yes
		}
	}
	JAP_Danne_big_army_faction_decrease_debugging = {
		priority = 999
		icon = generic_military
		allowed = {
			always = yes
		}

		visible = {
			is_debug = yes
			has_dynamic_modifier = { modifier = JAP_imperial_influence_dm }
		}
		complete_effect = {
			JAP_big_army_faction_loss = yes
		}
	}

	#NAVY
	JAP_Danne_small_navy_faction_increase_debugging = {
		priority = 999
		icon = generic_naval
		allowed = {
			always = yes
		}

		visible = {
			is_debug = yes
			has_dynamic_modifier = { modifier = JAP_imperial_influence_dm }
		}
		complete_effect = {
			JAP_small_naval_faction_gain = yes
		}
	}
	JAP_Danne_big_navy_faction_increase_debugging = {
		priority = 999
		icon = generic_naval
		allowed = {
			always = yes
		}

		visible = {
			is_debug = yes
			has_dynamic_modifier = { modifier = JAP_imperial_influence_dm }
		}
		complete_effect = {
			JAP_big_naval_faction_gain = yes
		}
	}
	JAP_Danne_small_navy_faction_decrease_debugging = {
		priority = 999
		icon = generic_naval
		allowed = {
			always = yes
		}

		visible = {
			is_debug = yes
			has_dynamic_modifier = { modifier = JAP_imperial_influence_dm }
		}
		complete_effect = {
			JAP_small_naval_faction_loss = yes
		}
	}
	JAP_Danne_big_navy_faction_decrease_debugging = {
		priority = 999
		icon = generic_naval
		allowed = {
			always = yes
		}

		visible = {
			is_debug = yes
			has_dynamic_modifier = { modifier = JAP_imperial_influence_dm }
		}
		complete_effect = {
			JAP_big_naval_faction_loss = yes
		}
	}
	#ZAIBATSU
	JAP_Danne_small_zaibatsu_faction_increase_debugging = {
		priority = 999
		icon = generic_factory
		allowed = {
			always = yes
		}

		visible = {
			is_debug = yes
			has_dynamic_modifier = { modifier = JAP_imperial_influence_dm }
		}
		complete_effect = {
			JAP_small_zaibatsu_faction_gain = yes
		}
	}
	JAP_Danne_big_zaibatsu_faction_increase_debugging = {
		priority = 999
		icon = generic_factory
		allowed = {
			always = yes
		}

		visible = {
			is_debug = yes
			has_dynamic_modifier = { modifier = JAP_imperial_influence_dm }
		}
		complete_effect = {
			JAP_big_zaibatsu_faction_gain = yes
		}
	}
	JAP_Danne_small_zaibatsu_faction_decrease_debugging = {
		priority = 999
		icon = generic_factory
		allowed = {
			always = yes
		}

		visible = {
			is_debug = yes
			has_dynamic_modifier = { modifier = JAP_imperial_influence_dm }
		}
		complete_effect = {
			JAP_small_zaibatsu_faction_loss = yes
		}
	}
	JAP_Danne_big_zaibatsu_faction_decrease_debugging = {
		priority = 999
		icon = generic_factory
		allowed = {
			always = yes
		}

		visible = {
			is_debug = yes
			has_dynamic_modifier = { modifier = JAP_imperial_influence_dm }
		}
		complete_effect = {
			JAP_big_zaibatsu_faction_loss = yes
		}
	}
	#GOVERNMENT
	JAP_Danne_small_government_faction_increase_debugging = {
		priority = 999
		icon = generic_political_address
		allowed = {
			always = yes
		}

		visible = {
			is_debug = yes
			has_dynamic_modifier = { modifier = JAP_imperial_influence_dm }
		}
		complete_effect = {
			JAP_small_government_faction_gain = yes
		}
	}
	JAP_Danne_big_government_faction_increase_debugging = {
		priority = 999
		icon = generic_political_address
		allowed = {
			always = yes
		}

		visible = {
			is_debug = yes
			has_dynamic_modifier = { modifier = JAP_imperial_influence_dm }
		}
		complete_effect = {
			JAP_big_government_faction_gain = yes
		}
	}
	JAP_Danne_small_government_faction_decrease_debugging = {
		priority = 999
		icon = generic_political_address
		allowed = {
			always = yes
		}

		visible = {
			is_debug = yes
			has_dynamic_modifier = { modifier = JAP_imperial_influence_dm }
		}
		complete_effect = {
			JAP_small_government_faction_loss = yes
		}
	}
	JAP_Danne_big_government_faction_decrease_debugging = {
		priority = 999
		icon = generic_political_address
		allowed = {
			always = yes
		}

		visible = {
			is_debug = yes
			has_dynamic_modifier = { modifier = JAP_imperial_influence_dm }
		}
		complete_effect = {
			JAP_big_government_faction_loss = yes
		}
	}
	JAP_put_hirohito_in_house_arrest_debugging = {
		priority = 999
		icon = generic_political_address
		allowed = {
			original_tag = JAP
		}

		visible = {
			is_debug = yes
		}
		complete_effect = {
			set_country_flag = JAP_emperor_hirohito_under_house_arrest_flag
		}
	}
}


#Category allowed for JAP
JAP_intervene_in_china = {

	JAP_china_step_up_war_effort = {

		icon = jap_conquer_china

		available = {
			JAP_has_idea_JAP_intervene_in_china = yes
		}

		visible = {
			JAP_has_idea_JAP_intervene_in_china = yes
			any_enemy_country = {
				is_literally_china = yes
			}
		}

		fire_only_once = no

		ai_will_do = {
			base = 201
			modifier = {
				has_war_with = USA
				factor = 10 #screw it, kill everything
			}
			modifier = {
				factor = 0
				has_country_flag = JAP_slow_down_in_china
				#NOT = { has_war_with = USA }
			}
		}
		modifier = {

		}

		days_remove = 0
		days_re_enable = 30

		cost = 25

		complete_effect = {
			IF = {
				limit = {
					USA = {
						has_war = no
					}
				}
				USA = { add_war_support = 0.025 }
			}
			JAP_intervene_in_china_level_down = yes
			hidden_effect = {
				set_country_flag = { flag = JAP_slow_down_in_china value = 1 days = 50 }
			}
		}
	}

	JAP_ichi_go = {

		icon = jap_conquer_china

		available = {	
			event_target:WTT_current_china_leader = {
				has_capitulated = no
				exists = yes
			}
		}

		visible = {
			has_completed_focus = JAP_strategic_offensives #JAP_secure_china
			any_enemy_country = {
				is_literally_china = yes
			}
			event_target:WTT_current_china_leader = {
				NOT = { is_puppet_of = JAP }
			}
		}

		fire_only_once = yes

		ai_will_do = {
			base = 5
			modifier = {
				is_historical_focus_on = yes
				date < 1944.1.1
				controls_state = 609 #East Heibei, to ensure that Japan hasn't been kicked off the mainland
				factor = 0
			}
		}

		cost = 50

		complete_effect = {
			IF = {
				limit = {
					USA = {
						has_war = no
					}
				}
				USA = { add_war_support = 0.1 }
			}
			IF = {
				limit = {
					has_dlc = "No Compromise, No Surrender"
				}
				add_timed_idea = {
					idea = JAP_ichi_go_sea
					days = 365
				}
			}
			ELSE = {
				add_timed_idea = {
					idea = JAP_ichi_go
					days = 365
				}
			}
				
			activate_mission_tooltip = JAP_conquer_china
			set_country_flag = JAP_conquer_china_activate
		}
	}

	JAP_conquer_china = {

		icon = jap_conquer_china

		available = {
			event_target:WTT_current_china_leader = {
				OR = {
					has_capitulated = yes
					exists = no
					is_subject_of = ROOT
				}
			}
		}

		visible = {
			JAP_has_idea_JAP_intervene_in_china = yes
			any_enemy_country = {
				is_literally_china = yes
			}
		}

		activation = {
			has_country_flag = JAP_conquer_china_activate
		}

		fire_only_once = yes

		is_good = no

		days_mission_timeout = 365
		
		timeout_effect = {
			add_stability = -0.05
			add_war_support = -0.15
		}

		complete_effect = {
			add_stability = 0.03
			add_war_support = 0.07
		}
	}

	
}

#JAP_interservice_rivalry = {
#
#	JAP_steel_for_guns = {
#
#		icon = generic_tank
#
#		visible = {
#			NOT = {
#				has_country_flag = JAP_steel_for_ships
#			}
#		}
#
#		available = {
#			NOT = {
#				has_country_flag = JAP_war_conferences_cd
#			}
#			NOT = {
#				has_country_flag = JAP_steel_for_ships
#			}
#		}
#
#		cost = 30
#
#		fire_only_once = yes
#
#		days_remove = -1
#
#		ai_will_do = {
#			base = 25
#		}
#
#		complete_effect = {
#			JAP_bop_medium_decrease_effect = yes
#			random_owned_state = {
#				limit = {
#					is_controlled_by = ROOT
#					is_core_of = ROOT
#					free_building_slots = {
#						building = arms_factory
#						size > 1
#						include_locked = yes
#					}
#				}
#				add_extra_state_shared_building_slots = 2
#				add_building_construction = {
#					type = arms_factory
#					level = 2
#					instant_build = yes
#				}
#			}
#			random_owned_state = {
#				limit = {
#					is_controlled_by = ROOT
#					is_core_of = ROOT
#					free_building_slots = {
#						building = arms_factory
#						size > 1
#						include_locked = yes
#					}
#				}
#				add_extra_state_shared_building_slots = 2
#				add_building_construction = {
#					type = arms_factory
#					level = 2
#					instant_build = yes
#				}
#			}
#			set_country_flag = { flag = JAP_war_conferences_cd value = 1 days = 180 }
#			JAP_interservice_rivalry_towards_army = yes
#			set_country_flag = JAP_steel_for_guns
#		}
#	}
#
#	JAP_steel_for_ships = {
#
#		icon = generic_naval
#
#		visible = {
#			NOT = {
#				has_country_flag = JAP_steel_for_guns
#			}
#		}
#
#		available = {
#			NOT = {
#				has_country_flag = JAP_war_conferences_cd
#			}
#			NOT = {
#				has_country_flag = JAP_steel_for_guns
#			}
#		}
#		
#		cost = 30
#
#		fire_only_once = yes
#
#		days_remove = -1
#
#		ai_will_do = {
#			base = 1
#		}
#
#		complete_effect = {
#			JAP_bop_medium_increase_effect = yes
#			random_owned_state = {
#				limit = {
#					is_controlled_by = ROOT
#					is_core_of = ROOT
#					free_building_slots = {
#						building = dockyard
#						size > 1
#						include_locked = yes
#					}
#				}
#				add_extra_state_shared_building_slots = 2
#				add_building_construction = {
#					type = dockyard
#					level = 2
#					instant_build = yes
#				}
#			}
#			random_owned_state = {
#				limit = {
#					is_controlled_by = ROOT
#					is_core_of = ROOT
#					free_building_slots = {
#						building = dockyard
#						size > 1
#						include_locked = yes
#					}
#				}
#				add_extra_state_shared_building_slots = 2
#				add_building_construction = {
#					type = dockyard
#					level = 2
#					instant_build = yes
#				}
#			}
#			set_country_flag = { flag = JAP_war_conferences_cd value = 1 days = 180 }
#			JAP_interservice_rivalry_towards_navy = yes
#			set_country_flag = JAP_steel_for_ships
#		}
#	}
#
#	JAP_prioritize_army_aircraft_construction = {
#
#		icon = generic_tank
#
#		available = {
#			NOT = {
#				has_country_flag = JAP_war_conferences_cd
#			}
#			NOT = {
#				has_country_flag = JAP_prioritize_naval_aircraft_construction
#			}
#		}
#		visible = {
#			NOT = {
#				has_country_flag = JAP_prioritize_naval_aircraft_construction
#			}
#		}
#		cost = 30
#		fire_only_once = yes
#		days_remove = -1
#		ai_will_do = {
#			factor = 1
#			modifier = {
#				factor = 0
#				date < 1938.9.1
#			}
#		}
#		complete_effect = {
#			JAP_bop_medium_decrease_effect = yes
#			set_country_flag = { flag = JAP_war_conferences_cd value = 1 days = 180 }
#			add_ideas = JAP_prioritize_army_aircraft_construction
#			JAP_interservice_rivalry_towards_army = yes
#			set_country_flag = JAP_prioritize_army_aircraft_construction
#		}
#	}
#	JAP_prioritize_naval_aircraft_construction = {
#
#		icon = generic_naval
#
#		available = {
#			NOT = {
#				has_country_flag = JAP_war_conferences_cd
#			}
#			NOT = {
#				has_country_flag = JAP_prioritize_army_aircraft_construction
#			}
#		}
#		visible = {
#			NOT = {
#				has_country_flag = JAP_prioritize_army_aircraft_construction
#			}
#		}
#		cost = 30
#		fire_only_once = yes
#		days_remove = -1
#		ai_will_do = {
#			factor = 2
#			modifier = {
#				factor = 0
#				date < 1938.9.1
#			}
#		}
#		complete_effect = {
#			JAP_bop_medium_increase_effect = yes 
#			set_country_flag = { flag = JAP_war_conferences_cd value = 1 days = 180 }
#			add_ideas = JAP_prioritize_naval_aircraft_construction
#			JAP_interservice_rivalry_towards_navy = yes
#			set_country_flag = JAP_prioritize_naval_aircraft_construction
#		}
#	}
#	JAP_everybody_serves = {
#
#		icon = generic_tank
#
#		available = {
#			NOT = {
#				has_country_flag = JAP_war_conferences_cd
#			}
#			NOT = {
#				has_country_flag = JAP_draft_exemptions
#			}
#		}
#		visible = {
#			NOT = {
#				has_country_flag = JAP_draft_exemptions
#			}
#		}
#		cost = 30
#		fire_only_once = yes
#		days_remove = -1
#		ai_will_do = {
#			factor = 1
#			modifier = {
#				factor = 0
#				date < 1939.1.1
#			}
#		}
#		modifier = {
#			conscription = 0.02
#		}
#		complete_effect = {
#			JAP_bop_medium_decrease_effect = yes
#			set_country_flag = { flag = JAP_war_conferences_cd value = 1 days = 180 }
#			JAP_interservice_rivalry_towards_army = yes
#			set_country_flag = JAP_everybody_serves
#		}
#	}
#	JAP_draft_exemptions = {
#
#		icon = generic_naval
#
#		available = {
#			NOT = {
#				has_country_flag = JAP_war_conferences_cd
#			}
#			NOT = {
#				has_country_flag = JAP_everybody_serves
#			}
#		}
#		visible = {
#			NOT = {
#				has_country_flag = JAP_everybody_serves
#			}
#		}
#		cost = 30
#		days_remove = -1
#		fire_only_once = yes
#		ai_will_do = {
#			factor = 3
#			modifier = {
#				factor = 0
#				date < 1939.1.1
#			}
#		}
#		modifier = {
#			industrial_capacity_factory = 0.05
#			industrial_capacity_dockyard = 0.05
#		}
#		complete_effect = {
#			JAP_bop_medium_increase_effect = yes
#			set_country_flag = { flag = JAP_war_conferences_cd value = 1 days = 180 }
#			JAP_interservice_rivalry_towards_navy = yes
#			set_country_flag = JAP_draft_exemptions
#		}
#	}
#	JAP_raiding_regiments = {
#
#		icon = generic_tank
#
#		available = {
#			NOT = {
#				has_country_flag = JAP_war_conferences_cd
#			}
#			NOT = {
#				has_country_flag = JAP_special_air_landing_force
#			}
#		}
#		visible = {
#			NOT = {
#				has_country_flag = JAP_special_air_landing_force
#			}
#		}
#		cost = 30
#		fire_only_once = yes
#		days_remove = -1
#		ai_will_do = {
#			factor = 1
#			modifier = {
#				factor = 0
#				date < 1939.1.1
#			}
#		}
#		modifier = {
#			special_forces_cap = 0.02
#		}
#		complete_effect = {
#			JAP_bop_medium_decrease_effect = yes
#			set_country_flag = { flag = JAP_war_conferences_cd value = 1 days = 180 }
#			set_country_flag = JAP_raiding_regiments
#			JAP_interservice_rivalry_towards_army = yes
#		}
#	}
#	JAP_special_air_landing_force = {
#
#		icon = generic_naval
#
#		available = {
#			NOT = {
#				has_country_flag = JAP_war_conferences_cd
#			}
#			NOT = {
#				has_country_flag = JAP_raiding_regiments
#			}
#		}
#		visible = {
#			NOT = {
#				has_country_flag = JAP_raiding_regiments
#			}
#		}
#		cost = 30
#		fire_only_once = yes
#		days_remove = -1
#		ai_will_do = {
#			factor = 1
#			modifier = {
#				factor = 0
#				date < 1939.1.1
#			}
#		}
#		modifier = {
#			special_forces_attack_factor = 0.05 
#			special_forces_defence_factor = 0.05
#		}
#		complete_effect = {
#			JAP_bop_medium_increase_effect = yes
#			set_country_flag = { flag = JAP_war_conferences_cd value = 1 days = 180 }
#			set_country_flag = JAP_special_air_landing_force
#			JAP_interservice_rivalry_towards_navy = yes
#		}
#	}
#	JAP_favor_army = {
#
#		icon = generic_tank
#
#		available = {
#			NOT = {
#				has_country_flag = JAP_war_conferences_cd
#			}
#			AND = {
#				OR = { 
#					has_country_flag = JAP_raiding_regiments 
#					has_country_flag = JAP_special_air_landing_force
#				}
#				OR = { 
#					has_country_flag = JAP_everybody_serves
#					has_country_flag = JAP_draft_exemptions
#				}
#				OR = { 
#					has_country_flag = JAP_prioritize_naval_aircraft_construction
#					has_country_flag = JAP_prioritize_army_aircraft_construction
#				}
#				OR = { 
#					has_country_flag = JAP_steel_for_guns
#					has_country_flag = JAP_steel_for_ships
#				}
#			}
#			
#		}
#		visible = {
#			AND = {
#				OR = { 
#					has_country_flag = JAP_raiding_regiments 
#					has_country_flag = JAP_special_air_landing_force
#				}
#				OR = { 
#					has_country_flag = JAP_everybody_serves
#					has_country_flag = JAP_draft_exemptions
#				}
#				OR = { 
#					has_country_flag = JAP_prioritize_naval_aircraft_construction
#					has_country_flag = JAP_prioritize_army_aircraft_construction
#				}
#				OR = { 
#					has_country_flag = JAP_steel_for_guns
#					has_country_flag = JAP_steel_for_ships
#				}
#			}
#		}
#		cost = 30
#		fire_only_once = yes
#		ai_will_do = {
#			factor = 1
#		}
#		
#		complete_effect = {
#			set_country_flag = { flag = JAP_war_conferences_cd value = 1 days = 180 }
#			JAP_interservice_rivalry_towards_army = yes
#		}
#	}
#	JAP_favor_navy = {
#
#		icon = generic_naval
#
#		available = { 
#			NOT = {
#				has_country_flag = JAP_war_conferences_cd
#			}
#			AND = {
#				OR = { 
#					has_country_flag = JAP_raiding_regiments 
#					has_country_flag = JAP_special_air_landing_force
#				}
#				OR = { 
#					has_country_flag = JAP_everybody_serves
#					has_country_flag = JAP_draft_exemptions
#				}
#				OR = { 
#					has_country_flag = JAP_prioritize_naval_aircraft_construction
#					has_country_flag = JAP_prioritize_army_aircraft_construction
#				}
#				OR = { 
#					has_country_flag = JAP_steel_for_guns
#					has_country_flag = JAP_steel_for_ships
#				}
#			}
#			
#		}
#		visible = {
#			AND = {
#				OR = { 
#					has_country_flag = JAP_raiding_regiments 
#					has_country_flag = JAP_special_air_landing_force
#				}
#				OR = { 
#					has_country_flag = JAP_everybody_serves
#					has_country_flag = JAP_draft_exemptions
#				}
#				OR = { 
#					has_country_flag = JAP_prioritize_naval_aircraft_construction
#					has_country_flag = JAP_prioritize_army_aircraft_construction
#				}
#				OR = { 
#					has_country_flag = JAP_steel_for_guns
#					has_country_flag = JAP_steel_for_ships
#				}
#			}
#		}
#		cost = 30
#		fire_only_once = yes
#		ai_will_do = {
#			factor = 1
#		}
#		
#		complete_effect = {
#			set_country_flag = { flag = JAP_war_conferences_cd value = 1 days = 180 }
#			JAP_interservice_rivalry_towards_navy = yes
#		}
#	}
#}

foreign_politics = {

	# Offer Surrender Terms to China
	JAP_sue_for_peace_CHI = {

		allowed = {
			original_tag = JAP
		}

		priority = 10

		available = {
			FROM = { 
				surrender_progress < 0.2 # if they are losing, lets not allow it
			}
			custom_trigger_tooltip = {
				tooltip = JAP_sue_for_peace_TT
				# South Korea
				525 = {
					is_controlled_by_ROOT_or_ally = no
				}
				1029 = {
					is_controlled_by_ROOT_or_ally = no
				}
				1031 = {
					is_controlled_by_ROOT_or_ally = no
				}
				1030 = {
					is_controlled_by_ROOT_or_ally = no
				}
				# North Korea
				527 = {
					is_controlled_by_ROOT_or_ally = no
				}
				1028 = {
					is_controlled_by_ROOT_or_ally = no
				}
				NOT = {
					any_of = {
						array = CHI.core_states
						var:v = {
							NOT = {
								state = 524
							}
							controller = {
								OR = {
									tag = JAP
									AND = {
										is_subject_of = JAP
										OR = {
											tag = MEN
											tag = MAN
										}
									}
								}
							}
						}
					}
				}
				MAN = {
					OR = {
						exists = no
						NOT = {
							is_subject_of = JAP
						}
						has_capitulated = yes
					}
				}
			}
		}

		target_array = enemies

		target_root_trigger = {
			NOT = { has_country_flag = JAP_offered_china_white_peace_flag }
			is_subject = no
			any_enemy_country = {
				is_literally_china = yes
			}
		}
		
		target_trigger = {
			#Target is FROM
			FROM = {
				tag = event_target:WTT_current_china_leader
				has_war_with = ROOT
			}
		}

		visible = {
			FROM = { 
				exists = yes 
				is_subject = no
			}
		}

		cost = 0

		fire_only_once = yes

		ai_will_do = {
			base = 500
		}

		complete_effect = {
			set_country_flag = JAP_offered_china_white_peace_flag
			event_target:WTT_current_china_leader = {
				country_event = { 
					id = wtt_japan.126 
					days = 1 
				}
			}
		}
	}

	JAP_sue_for_peace_MAN = {

		allowed = {
			original_tag = JAP
		}

		priority = 15

		available = {
			FROM = { 
				surrender_progress < 0.2 # if they are losing, lets not allow it
			}
			custom_trigger_tooltip = {
				tooltip = JAP_sue_for_peace_TT
				# South Korea
				525 = {
					is_controlled_by_ROOT_or_ally = no
				}
				1029 = {
					is_controlled_by_ROOT_or_ally = no
				}
				1031 = {
					is_controlled_by_ROOT_or_ally = no
				}
				1030 = {
					is_controlled_by_ROOT_or_ally = no
				}
				# North Korea
				527 = {
					is_controlled_by_ROOT_or_ally = no
				}
				1028 = {
					is_controlled_by_ROOT_or_ally = no
				}
				NOT = {
					any_of = {
						array = CHI.core_states
						var:v = {
							NOT = {
								state = 524
							}
							controller = {
								OR = {
									tag = JAP
									AND = {
										is_subject_of = JAP
										tag = MEN
									}
								}
							}
						}
					}
				}
			}
		}


		target_trigger = {
			#Target is FROM
			FROM = {
				tag = MAN
				has_war_with = ROOT
			}
		}

		visible = {
			FROM = { 
				exists = yes 
				is_subject = no
			}
			is_subject = no
			has_war_with = FROM
		}

		cost = 0

		fire_only_once = yes

		ai_will_do = {
		
			base = 500

			modifier = {
				factor = 0
				casualties_inflicted_by = {
					opponent = MAN
					thousands < 10
				}
			}

			modifier = {
				factor = 0
				has_country_flag = JAP_dont_surrender_instantly_lock 
			}
		}

		complete_effect = {
			MAN = {
				country_event = { id = wtt_japan.129 days = 1 }
			}
		}
	}

	# Sueing for peace from being nuked, only available for a non-hist Japan 
	JAP_sue_for_peace_nuke = {

		allowed = {
			original_tag = JAP
		}

		priority = 25

		available = {
			has_global_flag = JAP_nuke_1
			has_global_flag = JAP_nuke_2
			has_navy_size = { size < 40 }
			NOT = {
				controls_state = 526
				controls_state = 645
			}
		}

		visible = {
			has_war = yes
			has_global_flag = JAP_nuke_1
			JAP = {
				OR = {
					has_completed_focus = JAP_the_crysanthemum_throne
					NOT = {
						has_completed_focus = JAP_sea_purge_the_kodoha_faction
					}
				}
			}
		}

		cost = 0

		days_remove = -1

		ai_will_do = {
			base = 15
			modifier = {
				# South Korea
				525 = {
					is_controlled_by_ROOT_or_ally = no
				}
				1029 = {
					is_controlled_by_ROOT_or_ally = no
				}
				1031 = {
					is_controlled_by_ROOT_or_ally = no
				}
				1030 = {
					is_controlled_by_ROOT_or_ally = no
				}
				# North Korea
				527 = {
					is_controlled_by_ROOT_or_ally = no
				}
				1028 = {
					is_controlled_by_ROOT_or_ally = no
				}
				factor = 10
			}
			modifier = {
				# Sakhalin
				537 = {
					is_controlled_by_ROOT_or_ally = no
				}
				factor = 3
			}
			modifier = {
				# Okinawa
				526 = {
					is_controlled_by_ROOT_or_ally = no
				}
				factor = 3
			}
		}

		modifier = {
			forced_surrender_limit = -1.0
		}

		remove_effect = {

		}

		fire_only_once = yes

		remove_trigger = {
			has_war = no
		}
		complete_effect = {
			hidden_effect = {
				clr_global_flag = JAP_nuke_1
				clr_global_flag = JAP_nuke_2
			}
		}
	}

	JAP_sue_for_peace_nuke_mission = {
		available = {
			has_global_flag = JAP_nuke_1
			has_global_flag = JAP_nuke_2
		}

		priority = 24

		visible = {
			NOT = {
				OR = {
					controls_state = 536
					controls_state = 533
					controls_state = 534
					controls_state = 532
					controls_state = 282
					controls_state = 530
					controls_state = 531
					controls_state = 528
					controls_state = 529
				}
			}
		}

		modifier = {
			
		}

		days_mission_timeout = 720
		fire_only_once = yes

		activation = {
			is_special_project_completed = sp:sp_nuclear_bomb
			has_war_with = JAP
		}

		complete_effect = {
			JAP = {
				custom_effect_tooltip = JAP_unlock_surrender_broadcast_tt
				unlock_decision_tooltip = JAP_sue_for_peace_nuke
			}
		}

	} 

	JAP_request_soviet_support = {

		icon = generic_prepare_civil_war

		priority = 50

		available = {
		}

		visible = {
			tag = JAP
			has_civil_war = yes
			has_government = communism
		}

		cost = 50

		fire_only_once = yes

		ai_will_do = {
			base = 25
		}

		complete_effect = {
			add_stability = -0.05
			add_popularity = {
				ideology = communism
				popularity = -0.05
			}	
			SOV = { 
				country_event = { 
					id = wtt_japan.118 
					hours = 3
				} 
			}
		}
	}

	# Demand Soviet Surrender
	JAP_demand_soviet_unions_surrender = {

		allowed = {
			original_tag = JAP
		}

		priority = 30

		visible = {
			FROM = { 
				exists = yes 
				is_subject = no
				has_war_with = ROOT
			}
			is_subject = no
			OR = {
				has_completed_focus = JAP_the_persimmon_has_ripened
				has_completed_focus = JAP_a_green_persimmon
				has_completed_focus = JAP_free_asians_from_soviet_opression
			}
		}

		target_array = enemies

		target_trigger = {
			#Target is FROM
			FROM = {
				original_tag = SOV
			}
		}

		available = {
			ROOT = { 
				surrender_progress < 0.02 # if we are losing, lets not allow it
			}

			FROM = {
				exists = yes 
				is_subject = no
				has_war_with = ROOT
				OR = {
					is_faction_leader = yes
					is_in_faction = no
				}
			}

			IF = {
				limit = {
					566 = {
						owner = {
							OR = {
								original_tag = FROM
								is_subject_of = FROM
								is_in_faction_with = FROM
							}
						}
					}
				}
				# Irkutsk
				566 = {
					is_controlled_by_ROOT_or_ally = yes
				}
			}

			IF = {
				limit = {
					564 = {
						owner = {
							OR = {
								original_tag = FROM
								is_subject_of = FROM
								is_in_faction_with = FROM
							}
						}
					}
				}
				# Buryatia
				564 = {
					is_controlled_by_ROOT_or_ally = yes
				}
			}
			
			IF = {
				limit = {
					563 = {
						owner = {
							OR = {
								original_tag = FROM
								is_subject_of = FROM
								is_in_faction_with = FROM
							}
						}
					}
				}
				# Chita
				563 = {
					is_controlled_by_ROOT_or_ally = yes
				}
			}

			IF = {
				limit = {
					408 = {
						owner = {
							OR = {
								original_tag = FROM
								is_subject_of = FROM
								is_in_faction_with = FROM
							}
						}
					}
				}
				# Vladivastok
				408 = {
					is_controlled_by_ROOT_or_ally = yes
				}
			}

			IF = {
				limit = {
					655 = {
						owner = {
							OR = {
								original_tag = FROM
								is_subject_of = FROM
								is_in_faction_with = FROM
							}
						}
					}
				}
				# North Sakhalin
				655 = {
					is_controlled_by_ROOT_or_ally = yes
				}
			}

			IF = {
				limit = {
					574 = {
						owner = {
							OR = {
								original_tag = FROM
								is_subject_of = FROM
								is_in_faction_with = FROM
							}
						}
					}
				}
				# Yakutsk
				574 = {
					is_controlled_by_ROOT_or_ally = yes
				}
			}

			IF = {
				limit = {
					569 = {
						owner = {
							OR = {
								original_tag = FROM
								is_subject_of = FROM
								is_in_faction_with = FROM
							}
						}
					}
				}
				# Khakassia
				569 = {
					is_controlled_by_ROOT_or_ally = yes
				}
			}

			IF = {
				limit = {
					654 = {
						owner = {
							OR = {
								original_tag = FROM
								is_subject_of = FROM
								is_in_faction_with = FROM
							}
						}
					}
				}
				# Oyrot Region
				654 = {
					is_controlled_by_ROOT_or_ally = yes
				}
			}

			IF = {
				limit = {
					409 = {
						owner = {
							OR = {
								original_tag = FROM
								is_subject_of = FROM
								is_in_faction_with = FROM
							}
						}
					}
				}
				# Khabarovsk
				409 = {
					is_controlled_by_ROOT_or_ally = yes
				}
			}

		}

		cost = 50

		fire_only_once = yes

		ai_will_do = {
			base = 400
		}

		complete_effect = {
			FROM = {
				country_event = { 
					id = SEA_japan_foreign_policy.70
					days = 1 
				}
			}
		}
	}

	JAP_core_KOR_state = {
		icon = GFX_decision_infiltrate_state
	
		allowed = {
			original_tag = JAP
		}
		
		visible = {
			has_completed_focus = JAP_integrate_the_government_general
		}
		
		available = {
			#NOT = { has_country_flag = JAP_coring_KOR_state_in_progress_flag }
			FROM = {
				compliance > 40
			}
		}

		state_target = any_controlled_state
	    
	    target_trigger = {
	        FROM = {
	        	NOT = { is_core_of = ROOT }
	        	is_fully_controlled_by = ROOT
	        	is_core_of = KOR
	        }
	    }
	    on_map_mode = map_only

	    cost = 30		

		fire_only_once = yes

		days_remove = 30

		complete_effect = {
			#hidden_effect = {
			#	set_country_flag = { flag = JAP_coring_KOR_state_in_progress_flag value = 1 days = 31 }
			#}
		}

		remove_effect = {
			#hidden_effect = {
			#	clr_country_flag = JAP_coring_KOR_state_in_progress_flag
			#}
			IF = {
				limit = {
					FROM = {
						NOT = {
							is_owned_by = ROOT
						}
					}
				}
				FROM = {
					add_core_of = ROOT
					transfer_state_to = ROOT
				}
			}
			ELSE = {
				FROM = {
					add_core_of = ROOT
				}
			}
		}

		cancel_trigger = {
			FROM = {
				NOT = { is_fully_controlled_by = ROOT }
			}
		}

		cancel_effect = {
			#hidden_effect = {
			#	clr_country_flag = JAP_coring_KOR_state_in_progress_flag
			#}
		}
	}

	JAP_core_MAN_state = {
		icon = GFX_decision_infiltrate_state
	
		allowed = {
			original_tag = JAP
		}
		
		visible = {
			has_completed_focus = JAP_integrate_the_great_empire_of_manchuria
		}
		
		available = {
			#NOT = { has_country_flag = JAP_coring_MAN_state_in_progress_flag }
			FROM = {
				compliance > 40
			}
		}

		state_target = any_controlled_state
	    
	    target_trigger = {
	        FROM = {
	        	NOT = { is_core_of = ROOT }
	        	is_fully_controlled_by = ROOT
	        	is_core_of = MAN
	        }
	    }
	    on_map_mode = map_only

	    cost = 30		

		fire_only_once = yes

		days_remove = 30

		complete_effect = {
			#hidden_effect = {
			#	set_country_flag = { flag = JAP_coring_MAN_state_in_progress_flag value = 1 days = 31 }
			#}
		}

		remove_effect = {
			#hidden_effect = {
			#	clr_country_flag = JAP_coring_MAN_state_in_progress_flag
			#}
			IF = {
				limit = {
					FROM = {
						NOT = {
							is_owned_by = ROOT
						}
					}
				}
				FROM = {
					add_core_of = ROOT
					transfer_state_to = ROOT
				}
			}
			ELSE = {
				FROM = {
					add_core_of = ROOT
				}
			}
		}

		cancel_trigger = {
			FROM = {
				NOT = { is_fully_controlled_by = ROOT }
			}
		}

		cancel_effect = {
			#hidden_effect = {
			#	clr_country_flag = JAP_coring_MAN_state_in_progress_flag
			#}
		}
	}

}

#Category allowed for JAP
#Not visible if puppet
JAP_southern_expansion = {

	#JAP_pressure_france = { 
#
	#	available = {
	#		16 = { NOT = { is_controlled_by = FRA } } #Paris has fallen
	#		286 = { 
	#			CONTROLLER = { 
	#				NOT = {
	#					has_war_with = ROOT
	#					is_in_faction_with = ROOT
	#				}
	#			} 
	#		}
	#		670 = { 
	#			CONTROLLER = { 
	#				NOT = {
	#					has_war_with = ROOT
	#					is_in_faction_with = ROOT
	#				}
	#			} 
	#		}
	#		671 = { 
	#			CONTROLLER = { 
	#				NOT = {
	#					has_war_with = ROOT
	#					is_in_faction_with = ROOT
	#				}
	#			} 
	#		}
	#		1017 = { 
	#			CONTROLLER = { 
	#				NOT = {
	#					has_war_with = ROOT
	#					is_in_faction_with = ROOT
	#				}
	#			} 
	#		}
	#		custom_trigger_tooltip = {
	#			tooltip = demand_indochina_focus_tt
	#			OR = {
	#				286 = { 
	#					CONTROLLER = { 
	#						OR = { 
	#							tag = FRA 
	#							tag = VIC
	#							is_subject_of = FRA
	#							is_subject_of = VIC 
	#						} 
	#					}
	#				}
	#				670 = { 
	#					CONTROLLER = { 
	#						OR = { 
	#							tag = FRA 
	#							tag = VIC 
	#							is_subject_of = FRA
	#							is_subject_of = VIC
	#						} 
	#					}
	#				}
	#				671 = { 
	#					CONTROLLER = { 
	#						OR = { 
	#							tag = FRA 
	#							tag = VIC 
	#							is_subject_of = FRA
	#							is_subject_of = VIC
	#						} 
	#					}
	#				}
	#				1017 = { 
	#					CONTROLLER = { 
	#						OR = { 
	#							tag = FRA 
	#							tag = VIC 
	#							is_subject_of = FRA
	#							is_subject_of = VIC
	#						} 
	#					}
	#				}
	#			}
	#		}
	#	}
#
	#	visible = {
	#		has_completed_focus = JAP_strike_south_doctrine
	#	}
#
	#	fire_only_once = yes
#
	#	modifier = {
	#	}
#
	#	cost = 50
#
	#	ai_will_do = {
	#		base = 5
	#		modifier = {
	#			factor = 0
	#			FRA = { has_war = no }
	#		}			
	#		modifier = {
	#			factor = 5
	#			FRA = { has_war = yes } 
	#			strength_ratio = {
	#				tag = FRA
	#				ratio > 0.9
	#			}
	#		}
	#	}
#
	#	complete_effect = {
	#		IF = {
	#			limit = {
	#				FRA = {
	#					OR = {
	#						controls_state = 671
	#						671 = { CONTROLLER = { is_subject_of = FRA } }
	#						controls_state = 670
	#						670 = { CONTROLLER = { is_subject_of = FRA } }
	#						controls_state = 286
	#						286 = { CONTROLLER = { is_subject_of = FRA } }
	#						controls_state = 1017
	#						1017 = { CONTROLLER = { is_subject_of = FRA } }
	#					}
	#				}
	#			}
	#			FRA = { country_event = { id = france.1 } }
	#		}
	#		ELSE_IF = {
	#			limit = {
	#				VIC = {
	#					OR = {
	#						controls_state = 671
	#						controls_state = 670
	#						controls_state = 286
	#						controls_state = 1017
	#						671 = { CONTROLLER = { is_subject_of = VIC } }
	#						670 = { CONTROLLER = { is_subject_of = VIC } }
	#						286 = { CONTROLLER = { is_subject_of = VIC } }
	#						1017 = { CONTROLLER = { is_subject_of = VIC } }
	#					}
	#				}
	#			}
	#			VIC = { country_event = { id = france.1 } }
	#		}
	#	}
#
	#}
}

#Category allowed for JAP
#Visible when has completed JAP_pacific_guardian focus.
#Visible if independent
JAP_pacific_guardian = {

	JAP_release_korea = {

		icon = generic_independence

		available = {
			country_exists = KOR
		}

		days_mission_timeout = 180

		fire_only_once = yes
		is_good = no 
		activation = {
			has_completed_focus = JAP_the_korean_question
			has_full_control_of_state = 525
			has_full_control_of_state = 527
			KOR = { exists = no }
		}

		complete_effect = {
			add_political_power = 50
		}
		timeout_effect = {
			add_stability = -0.1 #naughty
		}
	}

	JAP_guardian_of_INS = {

		icon = jap_pacific_guardian

		visible = {
			has_completed_focus = JAP_pacific_guardian
		}

		available = {
			HOL = {
				#has_capitulated = yes
				NOT =  { has_war_with = ROOT}
			}
			"INS" = {
				is_puppet_of = HOL
			}
		}

		fire_only_once = yes


		modifier = {

		}

		days_remove = 0
		days_re_enable = 0

		cost = 50

		ai_will_do = {
			factor = 1
		}

		complete_effect = {
			HOL = { 
				country_event = { 
					id = wtt_japan.1 
					hours = 6
				} 
			}
		}
	}

	JAP_guardian_of_MAL = {

		icon = jap_pacific_guardian

		visible = {
			has_completed_focus = JAP_pacific_guardian
		}

		available = {
			ENG = {
				#has_capitulated = yes
				NOT =  { has_war_with = ROOT}
			}
			MAL = {
				is_puppet_of = ENG
			}
		}

		fire_only_once = yes


		modifier = {

		}

		days_remove = 0
		days_re_enable = 0

		cost = 50

		ai_will_do = {
			factor = 1
		}

		complete_effect = {
			ENG = { 
				country_event = { 
					id = wtt_japan.1 
					hours = 6
				} 
			}
		}
	}

	JAP_guardian_of_indochina = {

		icon = jap_pacific_guardian

		visible = {
			has_completed_focus = JAP_pacific_guardian
		}

		available = {
			FRA = {
				#has_capitulated = yes
				NOT =  { has_war_with = ROOT}
				OR = {
					has_full_control_of_state = 670
					has_full_control_of_state = 671
					has_full_control_of_state = 286
					has_full_control_of_state = 741
				}
			}
		}

		fire_only_once = yes


		modifier = {

		}

		days_remove = 0
		days_re_enable = 0

		cost = 50

		ai_will_do = {
			factor = 1
		}

		complete_effect = {
			FRA = { 
				country_event = { 
					id = wtt_japan.1 
					hours = 3
				} 
			}
		}
	}

	# Assume Guardianship over §Y[FROM.GetNameDef]§! (SEA verison guardian decision)
	JAP_assume_guardianship_over_asian_subject_decison = {
		icon = GFX_decision_jap_pacific_guardian

		priority = 50
	
		allowed = {
		}

		ai_will_do = {
			base = 25
		}
		
		visible = {
			has_completed_focus = JAP_free_colonized_asian_countries
		}
		available = {
			NOT = { has_country_flag = JAP_currently_trying_to_become_a_nations_guardian_flag }
		}

		target_array = global.asian_countries
	    
	    target_trigger = {
	        FROM = {
	        	is_subject = yes
	        	NOT = {
	        		# Shouldn't be doable on India 
	        		original_tag = RAJ
	        	}
	        	OVERLORD = {
	        		capital_scope = {
	        			NOT = {
	        				is_on_continent = asia
	        			}
	        		}
	        	}
	        	NOT = {
	        		has_war_with = ROOT
	        		is_subject_of = ROOT
	        	}
	        }
	    }

	    on_map_mode = decision_view_only 

	    cost = 75		
		fire_only_once = yes

		days_remove = 30

		complete_effect = {
			hidden_effect = {
				set_country_flag = { flag = JAP_currently_trying_to_become_a_nations_guardian_flag value = 1 days = 31 }
			}
		}
		remove_effect = {
			hidden_effect = {
				clr_country_flag = JAP_currently_trying_to_become_a_nations_guardian_flag
			}
			IF = {
				limit = {
					# This is only to avoid being spammed with errors for no particular reason when scoping to their overlord
					FROM = {
						is_subject = yes
					}
				}
				FROM = {
					OVERLORD = {
						country_event = {
							id = SEA_japan_foreign_policy.115
							hours = 6
							random_hours = 12
						}	
					}
					set_country_flag = JAP_this_is_the_country_being_negotiated_at_the_moment
				}
			}
			custom_effect_tooltip = if_they_accept_tt
			effect_tooltip = {
				FROM = {
					drop_cosmetic_tag = yes
				}
				puppet = {
				    target = FROM
				    end_wars = yes
				}
			}
		}

		cancel_trigger = {
			FROM = {
				OR = {
					exists = no
					is_subject = no
					is_subject_of = ROOT
					has_war_with = ROOT
				}
			}
		}

		cancel_effect = {
			hidden_effect = {
				clr_country_flag = JAP_currently_trying_to_become_a_nations_guardian_flag
			}
		}
	}

	# Invite Asian Nation to your faction decision 
	JAP_invite_demo_or_na_asian_nation_to_faction_decison = {
		icon = GFX_decision_hol_exchange_intelligence_data

		priority = 30
	
		allowed = {
		}

		ai_will_do = {
			base = 50
		}
		
		visible = {
			has_completed_focus = JAP_create_greater_east_asian_treaty_organization
		}

		available = {
			is_subject = no 
			OR = {
				is_faction_leader = yes
				AND = {
					is_faction_leader = no
					any_allied_country = {
						is_faction_leader = yes
						has_government = democratic 
					}
				}
			}
		}

		target_array = global.asian_and_oceanian_countries
	    
	    target_trigger = {
	        FROM = {
	        	is_subject = no
	        	is_in_faction = no
	        	NOT = {
	        		has_war_with = ROOT
	        	}
	        }
	    }

	    on_map_mode = decision_view_only 

	    cost = 50		
		fire_only_once = yes

		#days_remove = 30

		complete_effect = {

			FROM = {
				country_event = {
					id = SEA_japan_foreign_policy.118
					hours = 6
					random_hours = 12
				}	
			}
			custom_effect_tooltip = if_they_accept_tt
			effect_tooltip = {
				ROOT = {
					add_to_faction = FROM
				}
			}
			
		}

		remove_effect = {

		}

		cancel_trigger = {
			
		}

		cancel_effect = {
			
		}
	}

}

JAP_the_red_sun_over_asia_decisions = {
	
	# Invite Communust South American Nations to your faction decision 
	JAP_invite_com_south_ame_nation_to_faction_decison = {
		icon = GFX_decision_hol_exchange_intelligence_data

		priority = 30
	
		allowed = {
		}

		ai_will_do = {
			base = 50
		}
		
		visible = {
			has_completed_focus = JAP_trans_pacific_influence
		}
		available = {
			
		}

		target_array = global.south_american_countries
	    
	    target_trigger = {
	        FROM = {
	        	is_subject = no
	        	is_in_faction = no
	        	NOT = {
	        		has_war_with = ROOT
	        	}
	        	has_government = communism
	        }
	    }

	    on_map_mode = decision_view_only 

	    cost = 50		
		fire_only_once = yes

		#days_remove = 30

		complete_effect = {

			FROM = {
				country_event = {
					id = SEA_japan_foreign_policy.118
					hours = 6
					random_hours = 12
				}	
			}
			custom_effect_tooltip = if_they_accept_tt
			effect_tooltip = {
				ROOT = {
					add_to_faction = FROM
				}
			}
			
		}

		remove_effect = {

		}

		cancel_trigger = {
			
		}

		cancel_effect = {
			
		}
	}

	JAP_communist_core_asian_state = {

		icon = GFX_decision_generic_form_nation

		ai_will_do = {
			base = 50
		}

		priority = 25

		highlight_states = {
			highlight_state_targets = {
				state = FROM 
			} 
		}
	
		allowed = {
			original_tag = JAP
		}
		
		visible = {
			has_completed_focus = JAP_the_pacific_union_of_soviet_socialist_republics
		}
		
		available = {
			FROM = {
				NOT = { has_state_flag = JAP_coring_this_asian_state_in_progress_flag }
			}
			FROM = {
				compliance > 45
			}
		}

		state_target = any_controlled_state
	    
	    target_trigger = {
	        FROM = {
	        	NOT = { is_core_of = ROOT }
	        	is_fully_controlled_by = ROOT
	        	OR = {
	        		is_on_continent = asia
	        		is_on_continent = middle_east
	        		is_on_continent = australia
	        	}
	        	OR = {
	        		any_neighbor_state = {
	        			is_core_of = ROOT
	        		}
	        		is_coastal = yes
	        	}
	        }
	    }
	    on_map_mode = map_only

	    cost = 50		

		fire_only_once = yes

		days_remove = 35

		complete_effect = {
			hidden_effect = {
				FROM = {
					set_state_flag = { flag = JAP_coring_this_asian_state_in_progress_flag value = 1 days = 31 }
				}
			}
		}

		remove_effect = {
			hidden_effect = {
				FROM = {
					clr_state_flag = JAP_coring_this_asian_state_in_progress_flag
				}
			}

			FROM = {
				add_core_of = ROOT
			}
			
		}

		cancel_trigger = {
			FROM = {
				NOT = { is_fully_controlled_by = ROOT }
			}
		}

		cancel_effect = {
			hidden_effect = {
				FROM = {
					clr_state_flag = JAP_coring_this_asian_state_in_progress_flag
				}
			}
		}
	}

	# Invite Communust Middle Eastern Nations to your faction decision 
	JAP_invite_com_middle_eastern_nation_to_faction_decison = {
		icon = GFX_decision_hol_exchange_intelligence_data

		priority = 30
	
		allowed = {
		}

		ai_will_do = {
			base = 50
		}
		
		visible = {
			has_completed_focus = JAP_spread_revolutionary_flames_to_west_asia
		}
		available = {
			
		}

		target_array = global.middle_eastern_countries
	    
	    target_trigger = {
	        FROM = {
	        	is_subject = no
	        	is_in_faction = no
	        	NOT = {
	        		has_war_with = ROOT
	        	}
	        	has_government = communism
	        }
	    }

	    on_map_mode = decision_view_only 

	    cost = 50		
		fire_only_once = yes

		#days_remove = 30

		complete_effect = {

			FROM = {
				country_event = {
					id = SEA_japan_foreign_policy.118
					hours = 6
					random_hours = 12
				}	
			}
			custom_effect_tooltip = if_they_accept_tt
			effect_tooltip = {
				ROOT = {
					add_to_faction = FROM
				}
			}
			
		}

		remove_effect = {

		}

		cancel_trigger = {
			
		}

		cancel_effect = {
			
		}
	}

	# Stir Communist Sentiments in Middle Eastern Nations
	JAP_stir_communist_sentiments_in_the_middle_east_decison = {
		icon = GFX_decision_eng_propaganda_campaigns

		priority = 31
	
		allowed = {
		}

		ai_will_do = {
			base = 50
		}
		
		visible = {
			has_completed_focus = JAP_spread_revolutionary_flames_to_west_asia
		}
		available = {
			
		}

		target_array = global.middle_eastern_countries
	    
	    target_trigger = {
	        FROM = {
	        	NOT = {
	        		has_war_with = ROOT
	        	}
	        	NOT = {
	        		has_government = communism
	        	}
	        }
	    }

	    on_map_mode = decision_view_only 

	    cost = 50		
		fire_only_once = yes

		#days_remove = 30

		complete_effect = {

			FROM = {
				country_event = {
					id = SEA_japan_popup_events.37
					hours = 6
					random_hours = 12
				}	
			}
			custom_effect_tooltip = if_they_accept_tt
			effect_tooltip = {
				add_timed_idea = {
					idea = JAP_fifth_international_agitation
					days = 720
				}
				add_stability = -0.05
			}
			
		}

		remove_effect = {

		}

		cancel_trigger = {
			
		}

		cancel_effect = {
			
		}
	}

	# Stir Communist Sentiments in Greater Indian Nations
	JAP_stir_communist_sentiments_in_south_asia_decison = {
		icon = GFX_decision_eng_propaganda_campaigns

		priority = 31
	
		allowed = {
		}

		ai_will_do = {
			base = 50
		}
		
		visible = {
			has_completed_focus = JAP_spread_revolutionary_flames_to_south_asia
		}
		available = {
			
		}

		target_array = global.asian_countries
	    
	    target_trigger = {
	        FROM = {
	        	NOT = {
	        		has_war_with = ROOT
	        	}
	        	NOT = {
	        		has_government = communism
	        	}
	        	OR = {
	        		original_tag = PAK
	        		original_tag = RAJ
	        		original_tag = KAS
	        		original_tag = KHL
	        		original_tag = NWF
	        		original_tag = BLC
	        		original_tag = KLT
	        		original_tag = SIN
	        		original_tag = RJP
	        		original_tag = WIS
	        		original_tag = CIP
	        		original_tag = HYD
	        		original_tag = KOL
	        		original_tag = MYS
	        		original_tag = RAS
	        		original_tag = BAN
	        		original_tag = SKK
	        		original_tag = MPU
	        		original_tag = BRM
	        		original_tag = BHU
	        		original_tag = NEP
	        		original_tag = AFG
	        	}
	        }
	    }

	    on_map_mode = decision_view_only 

	    cost = 50		
		fire_only_once = yes

		#days_remove = 30

		complete_effect = {

			FROM = {
				country_event = {
					id = SEA_japan_popup_events.37
					hours = 6
					random_hours = 12
				}	
			}
			custom_effect_tooltip = if_they_accept_tt
			effect_tooltip = {
				add_timed_idea = {
					idea = JAP_fifth_international_agitation
					days = 720
				}
				add_stability = -0.05
			}
			
		}

		remove_effect = {

		}

		cancel_trigger = {
			
		}

		cancel_effect = {
			
		}
	}

	# Invite Communust South Asian Nations to your faction decision 
	JAP_invite_com_south_asian_nation_to_faction_decison = {
		icon = GFX_decision_hol_exchange_intelligence_data

		priority = 30
	
		allowed = {
		}

		ai_will_do = {
			base = 50
		}
		
		visible = {
			has_completed_focus = JAP_spread_revolutionary_flames_to_south_asia
		}
		available = {
			
		}

		target_array = global.asian_countries
	    
	    target_trigger = {
	        FROM = {
	        	is_subject = no
	        	is_in_faction = no
	        	NOT = {
	        		has_war_with = ROOT
	        	}
	        	has_government = communism
	        	OR = {
	        		original_tag = PAK
	        		original_tag = RAJ
	        		original_tag = KAS
	        		original_tag = KHL
	        		original_tag = NWF
	        		original_tag = BLC
	        		original_tag = KLT
	        		original_tag = SIN
	        		original_tag = RJP
	        		original_tag = WIS
	        		original_tag = CIP
	        		original_tag = HYD
	        		original_tag = KOL
	        		original_tag = MYS
	        		original_tag = RAS
	        		original_tag = BAN
	        		original_tag = SKK
	        		original_tag = MPU
	        		original_tag = BRM
	        		original_tag = BHU
	        		original_tag = NEP
	        		original_tag = AFG
	        	}
	        }
	    }

	    on_map_mode = decision_view_only 

	    cost = 50		
		fire_only_once = yes

		#days_remove = 30

		complete_effect = {

			FROM = {
				country_event = {
					id = SEA_japan_foreign_policy.118
					hours = 6
					random_hours = 12
				}	
			}
			custom_effect_tooltip = if_they_accept_tt
			effect_tooltip = {
				ROOT = {
					add_to_faction = FROM
				}
			}
			
		}

		remove_effect = {

		}

		cancel_trigger = {
			
		}

		cancel_effect = {
			
		}
	}

	# Offer Economic Integration to §Y[FROM.GetName]§!
	JAP_PARF_economic_integration_decision = {
		priority = 3
		icon = GFX_decision_eng_trade_unions_support 

		ai_will_do = {
			base = 5
			modifier = {
				factor = 2
				any_enemy_country = {
					has_war_with = FROM
				}
			}
			modifier = {
				factor = 0.5
				FROM = {
					is_enemy_ideology = yes
				}
			}
			modifier = {
				factor = 2
				FROM = {
					has_government = ROOT
				}
			}
			modifier = {
				factor = 2
				strength_ratio = {
				    tag = FROM
				    ratio < 0.75
				}
			}
			modifier = {
				factor = 2
				strength_ratio = {
				    tag = FROM
				    ratio < 0.5
				}
			}
		}

		target_array = ROOT.allies

		target_trigger = {
			FROM = {
				NOT = {
					original_tag = JAP
				}
				capital_scope = { 
					OR = {
						is_on_continent = asia 
						is_on_continent = australia
						is_on_continent = middle_east
					}
				}
				is_subject = no
				has_idea = JAP_yen_bloc_idea
				NOT = {
					has_country_flag = JAP_has_sent_invitation_for_integration_once_already_flag
					has_country_flag = JAP_country_that_rejected_economic_integration_flag
				}
			}
		}

		available = {
			fighting_army_strength_ratio = {
			    tag = FROM
			    ratio > 2
			}
		}

		visible = {	
			has_completed_focus = JAP_a_common_currency_for_all_of_asia
			FROM = {
				is_in_faction_with = ROOT
			}
		}

		fire_only_once = yes

		cost = 100

		complete_effect = {
			FROM = {
				country_event = { id = SEA_japan_foreign_policy.45 days = 1 } 
				set_country_flag = JAP_has_sent_invitation_for_integration_once_already_flag
			}

			custom_effect_tooltip = if_they_accept_tt

			effect_tooltip = {
				puppet = {
					target = FROM
					end_wars = no
					end_civil_wars = no
				}		 
			}
		}
	}

	# Develop §Y[FROM.GetAdjective]§! Industries
	JAP_PARF_develop_member_industry_decision = {
		priority = 1
		icon = GFX_decision_hol_attract_foreign_investors 

		ai_will_do = {
			base = 10
		}

		target_array = ROOT.allies

		target_trigger = {
			FROM = {
				NOT = {
					original_tag = JAP
				}
				capital_scope = { 
					OR = {
						is_on_continent = asia 
						is_on_continent = australia
						is_on_continent = middle_east
					}
				}
				NOT = {
					has_country_flag = JAP_has_developed_froms_industry_once_already_flag
				}
			}
		}

		available = {
			
		}

		visible = {	
			has_completed_focus = JAP_development_for_the_undeveloped
			FROM = {
				is_in_faction_with = ROOT
			}
		}

		fire_only_once = yes

		cost = 50

		complete_effect = {
			FROM = {
				country_event = { id = SEA_japan_foreign_policy.48 days = 1 } 
				set_country_flag = JAP_has_developed_froms_industry_once_already_flag
			}

			custom_effect_tooltip = if_they_accept_tt
			FROM = {
				effect_tooltip = {
					add_tech_bonus = {
						bonus = 0.5
						uses = 2
						category = industry
					}
				}
				random_core_state = {
					limit = {
						is_owned_and_controlled_by = FROM
						free_building_slots = {
							building = industrial_complex
							size > 1
							include_locked = yes
						}
					}
					set_state_flag = JAP_state_development_target
					effect_tooltip = {
						add_extra_state_shared_building_slots = 2
						add_building_construction = {
							type = industrial_complex
							level = 2
							instant_build = yes
						}	
						IF = {
							limit = {
								infrastructure < 5
							}
							add_building_construction = {
								type = infrastructure
								level = 1
								instant_build = yes
							}	
						}
					}
				}
			}
		}
	}


}




JAP_colonial_independence = {

	JAP_return_manchuria = {

		icon = generic_independence

		allowed = {
			original_tag = JAP
		}

		visible = {
			OR = {
				has_completed_focus = JAP_liberate_manchuria
				has_completed_focus = JAP_democratic_war_with_manchukuo
			}
			609 = {
				owner = {
					OR = {
						is_puppet_of = JAP
						original_tag = JAP
					}
				}
			}
			610 = {
				owner = {
					OR = {
						is_puppet_of = JAP
						original_tag = JAP
					}
				}
			}
			716 = {
				owner = {
					OR = {
						is_puppet_of = JAP
						original_tag = JAP
					}
				}
			}
			715 = {
				owner = {
					OR = {
						is_puppet_of = JAP
						original_tag = JAP
					}
				}
			}
			328 = {
				owner = {
					OR = {
						is_puppet_of = JAP
						original_tag = JAP
					}
				}
			}
			717 = {
				owner = {
					OR = {
						is_puppet_of = JAP
						original_tag = JAP
					}
				}
			}
			714 = {
				owner = {
					OR = {
						is_puppet_of = JAP
						original_tag = JAP
					}
				}
			}
			761 = {
				owner = {
					OR = {
						is_puppet_of = JAP
						original_tag = JAP
					}
				}
			}
		}

		available = {
			is_faction_leader = yes
			609 = {
				is_fully_controlled_by = controller
				CONTROLLER = {
					OR = {
						is_puppet_of = JAP
						original_tag = JAP
					}
				}
			}
			610 = {
				is_fully_controlled_by = controller
				CONTROLLER = {
					OR = {
						is_puppet_of = JAP
						original_tag = JAP
					}
				}
			}
			716 = {
				is_fully_controlled_by = controller
				CONTROLLER = {
					OR = {
						is_puppet_of = JAP
						original_tag = JAP
					}
				}
			}
			715 = {
				is_fully_controlled_by = controller
				CONTROLLER = {
					OR = {
						is_puppet_of = JAP
						original_tag = JAP
					}
				}
			}
			328 = {
				is_fully_controlled_by = controller
				CONTROLLER = {
					OR = {
						is_puppet_of = JAP
						original_tag = JAP
					}
				}
			}
			717 = {
				is_fully_controlled_by = controller
				CONTROLLER = {
					OR = {
						is_puppet_of = JAP
						original_tag = JAP
					}
				}
			}
			714 = {
				is_fully_controlled_by = controller
				CONTROLLER = {
					OR = {
						is_puppet_of = JAP
						original_tag = JAP
					}
				}
			}
			761 = {
				is_fully_controlled_by = controller
				CONTROLLER = {
					OR = {
						is_puppet_of = JAP
						original_tag = JAP
					}
				}
			}
		}

		fire_only_once = yes


		modifier = {

		}

		days_remove = 0
		days_re_enable = 0

		cost = 10

		ai_will_do = {
			factor = 1
		}

		complete_effect = {
			IF = {
				limit = {
					country_exists = event_target:WTT_current_china_leader
				}
				event_target:WTT_current_china_leader = { 
					transfer_state = 609
					transfer_state = 610
					transfer_state = 716
					transfer_state = 715
					transfer_state = 328
					transfer_state = 717
					transfer_state = 714
					transfer_state = 761
					transfer_state = 745
					country_event = { id = wtt_japan.101 days = 1 }
					custom_effect_tooltip = JAP_liberate_manchuria_alliance_tt
				}
			}
			IF = {
				limit = {
					country_exists = event_target:WTT_communist_china
					NOT = { country_exists = event_target:WTT_current_china_leader }
				}
				event_target:WTT_communist_china = { 
					transfer_state = 609
					transfer_state = 610
					transfer_state = 716
					transfer_state = 715
					transfer_state = 328
					transfer_state = 717
					transfer_state = 714
					transfer_state = 761
					transfer_state = 745
					country_event = { id = wtt_japan.101 days = 1 }
				}
			}
			IF = {
				limit = {
					NOT = { country_exists = event_target:WTT_communist_china }
					NOT = { country_exists = event_target:WTT_current_china_leader }
				}
				random_other_country = {
					limit = {
						OR = {
							original_tag = GXC
							original_tag = YUN
							original_tag = XSM
							original_tag = SIK
							original_tag = SHX
							original_tag = MEN
						}
						NOT = {
							has_government = communism
							has_government = fascism
						}
					}
					transfer_state = 609
					transfer_state = 610
					transfer_state = 716
					transfer_state = 715
					transfer_state = 328
					transfer_state = 717
					transfer_state = 714
					transfer_state = 761
					transfer_state = 745
					country_event = { id = wtt_japan.101 days = 1 }
					custom_effect_tooltip = JAP_liberate_manchuria_alliance_tt
				}
			}
		}
	}
}

political_actions = {

	JAP_break_the_london_naval_treaty = {

		icon = generic_break_treaty

		allowed = {
			original_tag = JAP
		}

		available = {

		}

		visible = {
			has_idea = JAP_the_london_naval_treaty
			has_completed_focus = JAP_join_the_london_naval_treaty
		}

		fire_only_once = yes


		modifier = {

		}

		days_remove = 0
		days_re_enable = 0

		cost = 25

		ai_will_do = {
			factor = 0
		}

		complete_effect = {
			remove_ideas = JAP_the_london_naval_treaty
			FRA = { add_opinion_modifier = { target = ROOT modifier = JAP_broke_the_london_naval_treaty } }
			USA = { add_opinion_modifier = { target = ROOT modifier = JAP_broke_the_london_naval_treaty } }
			ENG = { add_opinion_modifier = { target = ROOT modifier = JAP_broke_the_london_naval_treaty } }
			FRA = { remove_opinion_modifier = { target = ROOT modifier = JAP_join_the_london_naval_treaty } }
			USA = { remove_opinion_modifier = { target = ROOT modifier = JAP_join_the_london_naval_treaty } }
			ENG = { remove_opinion_modifier = { target = ROOT modifier = JAP_join_the_london_naval_treaty } }
			remove_opinion_modifier = { target = FRA modifier = JAP_join_the_london_naval_treaty }
			remove_opinion_modifier = { target = USA modifier = JAP_join_the_london_naval_treaty }
			remove_opinion_modifier = { target = ENG modifier = JAP_join_the_london_naval_treaty }
		}		
	}

	# Promote Hayao Tada to Lieutenant General
	JAP_promote_hayao_tada_to_lieutenant_general_decision  = {

		priority = 50

		icon = GFX_decision_generic_army_support

		ai_will_do = {
			base = 250
		}

		allowed = {  
			original_tag = JAP
		}

		visible = { 
			NOT = { has_country_flag = JAP_promoted_hayao_tada_flag }
		} 

		available = {
			has_civil_war = no
			NOT = {
				has_idea = JAP_military_strike_idea
			}
		}

		days_remove = 35 

		custom_cost_trigger = {
			command_power > 24.9
		}
		custom_cost_text = ETH_build_local_resistance_force_cost

		complete_effect = {
			hidden_effect = {
				add_command_power = -25 
			}
		}

		modifier = {
		}

		remove_effect = {

			custom_effect_tooltip = JAP_promote_hayao_tada_to_lieutenant_general_tt

			hidden_effect = {
				set_country_flag = JAP_promoted_hayao_tada_flag 
			}
		}

	}

}

operations = {
	
	# Tora! Tora! Tora!
	JAP_tora_tora_tora = {
		
		allowed = {
			original_tag = JAP
		}

		icon = decision_generic_naval

		available = {
			OR = {
				has_war_with = HOL
				has_war_with = ENG
				has_war_with = USA
				has_war_with = FRA
			}
		}

		is_good = no
	
		fire_only_once = yes
	
		days_mission_timeout = 180
	
		activation = {
			has_completed_focus = JAP_strike_the_southern_road 
		}
		
		visible = {
			has_completed_focus = JAP_strike_the_southern_road
		}
	
		complete_effect = {
			add_timed_idea = { idea = JAP_tora_tora_tora_idea days = 180 }
		}
	}


	# First border incident
	JAP_test_the_soviets = {
		icon = border_war
		allowed = {
			original_tag = JAP
		}

		available = {
			OR = {
				has_completed_focus = JAP_sea_purge_the_kodoha_faction
				has_completed_focus = JAP_support_the_kodoha_faction
				has_completed_focus = JAP_revere_the_emperor_destroy_the_traitors
			}
			NOT = {
				has_war_with = SOV
				is_in_faction_with = SOV
				has_non_aggression_pact_with = SOV
				SOV = { is_puppet_of = JAP }
			}
			1028 = {
				any_neighbor_state = {
					is_controlled_by = SOV
				}
			}
		}

		visible = {
			NOT = {
				has_global_flag = JAP_kalkin_gol
				has_completed_focus = JAP_okadas_military_purge_speech
			}
		}

		highlight_states = {
	 		highlight_state_targets = {
				state = 408
				state = 1028
			} 
		}
		
		fire_only_once = yes

		ai_will_do = {
			base = 1
			modifier = {
				is_historical_focus_on = yes
				date < 1939.1.1
				factor = 0
			}
			modifier = { # We won't do this if we are supporting the opposition
				OR = {
					SOV = { has_country_flag = SOV_CSW_transfer_vladivostok_flag }
					SOV = { has_country_flag = SOV_CSW_transfer_sakhalin_flag }
				}
				factor = 0
			}
		}

		cost = 50

		days_remove = 30

		war_with_on_remove = SOV

		complete_effect = {
			1028 = {
				save_event_target_as = JAP_SOV_attacker_state
				set_state_flag = border_incident_active
			}
			408 = {
				save_event_target_as = JAP_SOV_defender_state
				set_state_flag = border_incident_active
			}
			SOV = {
				country_event = { id = japan_border_conflict.1 days = 1 }
				activate_targeted_decision = { target = JAP decision = JAP_border_conflict_warning_SOV }
			}
		}
		remove_effect = {
			activate_targeted_decision = { target = SOV decision = JAP_border_incident_forgotten }
			activate_targeted_decision = { target = SOV decision = JAP_escalate_incident_to_border_conflict_SOV }
		}
	}

	# Mission for defender warning that a conflict with FROM is coming
	JAP_border_conflict_warning_SOV = {

		icon = border_war

		allowed = { always = no } #Activated from effect

		available = {
			hidden_trigger = { always = no }
		}

		war_with_target_on_timeout = yes
		ai_will_do = {
			base = 0
			modifier = {
				
			}
		}

		days_mission_timeout = 30

		fire_only_once = yes

		is_good = no
		
		timeout_effect = {
			custom_effect_tooltip = escalation_possible_tooltip_for_defender
			custom_effect_tooltip = effects_if_border_conflict_is_lost
			effect_tooltip = {
				JAP = {
					add_doctrine_cost_reduction = {
						name = sov_jap_border_conflict_won
						category = land_doctrine
						cost_reduction = 0.5
					}
					add_tech_bonus = {
						name = sov_jap_border_conflict_won
						category = armor
						bonus = 1.0
					}
				}
			}
			hidden_effect = {
				remove_targeted_decision = { target = JAP decision = JAP_border_conflict_warning_SOV }
				activate_targeted_decision = { target = JAP decision = JAP_border_conflict_escalation_warning_SOV }
			}
		}
	}

	# Mission for defender warning FROM can escalate to war at any point is coming
	JAP_border_conflict_escalation_warning_SOV = {

		icon = border_war

		allowed = { always = no } #Activated from effect
		visible = { hidden_trigger = { NOT = { has_border_war_with = JAP } } }
		cancel_if_not_visible = yes 

		available = {
			#var:ROOT.defender_state_vs_@FROM = {
			#	has_ROOT_at_least_1_div_in_current_state_scope = yes
			#}
			hidden_trigger = { always = no }
		}

		war_with_target_on_timeout = yes
		ai_will_do = {
			base = 0
			modifier = {
				
			}
		}

		days_mission_timeout = 30

		fire_only_once = yes

		is_good = no

		timeout_effect = {
			custom_effect_tooltip = from_cannot_escalate
			custom_effect_tooltip = effects_if_border_conflict_is_lost
			effect_tooltip = {
				JAP = {
					add_doctrine_cost_reduction = {
						name = sov_jap_border_conflict_won
						category = land_doctrine
						cost_reduction = 0.5
					}
					add_tech_bonus = {
						name = sov_jap_border_conflict_won
						category = armor
						bonus = 1.0
					}
				}
			}
		}		
	}

	# Mission for attacker to escalate or incident is forgotten
	JAP_border_incident_forgotten = {

		icon = border_war

		allowed = { always = no } #Activated from effect

		available = {
			
			hidden_trigger = {
				OR = {
					has_border_war_with = SOV # Japan shouldn't lose war support if they actually use the window of opportunity
					has_country_flag = JAP_did_the_border_war_flag
				}
			}
				
		}

		highlight_states = {
			highlight_state_targets = {
				state = 1028
				state = 408
			} 
		}

		ai_will_do = {
			base = 0
			modifier = {
				
			}
		}

		days_mission_timeout = 30

		fire_only_once = yes

		is_good = no
		
		timeout_effect = {
			remove_targeted_decision = { target = SOV decision = JAP_escalate_incident_to_border_conflict_SOV }
			add_political_power = -100
			add_war_support = -0.1 #Shameful Display
			hidden_effect = {
				SOV = { remove_targeted_decision = { target = JAP decision = JAP_border_conflict_escalation_warning_SOV } }
				SOV = {
					1028 = {
						clr_state_flag = border_incident_active
					}
					408 = {
						clr_state_flag = border_incident_active
					}
				}
			}
		}
	}

	#Decision to escalate incident on border with SOV to border conflict
	JAP_escalate_incident_to_border_conflict_SOV = {

		icon = border_war

		allowed = { always = no } #Activated from effect

		available = {
			1028 = {
				OR = {
					is_fully_controlled_by = ROOT
					CONTROLLER = {
						is_subject_of = ROOT
					}
					CONTROLLER = {
						is_in_faction_with = ROOT
					}
				}
			}
			divisions_in_border_state = {
				state = 1028
				border_state = 408
				size > 0
			}
		}

		highlight_states = {
			highlight_state_targets = {
				state = 1028
				state = 408	
			} 
		}

		ai_will_do = {
			base = 10
			modifier = { 
				has_war = no
				factor = 10
			}
		}

		fire_only_once = yes #Reactivation handled in effect

		complete_effect = {
			remove_targeted_decision = { target = SOV decision = JAP_border_incident_forgotten }
			start_border_war = {
				change_state_after_war = no
				attacker = {
					state = 1028
					num_provinces = 4
					on_win = japan_border_conflict.2
					on_lose = japan_border_conflict.3
					on_cancel = japan_border_conflict.4
				}
				
				defender = {
					state = 408
					num_provinces = 4
					on_win = japan_border_conflict.3
					on_lose = japan_border_conflict.2
					on_cancel = japan_border_conflict.4
				}
			}
			SOV = {
				activate_targeted_decision = { target = JAP decision = JAP_border_conflict_escalate_conflict }
				activate_targeted_decision = { target = JAP decision = JAP_border_conflict_time_until_cancelled }
			}
			activate_targeted_decision = { target = SOV decision = JAP_border_conflict_escalate_conflict }
			activate_targeted_decision = { target = SOV decision = JAP_border_conflict_time_until_cancelled }
		}
	}
	#Mission for attacker to win border war against FROM in X days
	JAP_border_conflict_time_until_cancelled = {

		icon = border_war

		allowed = { always = no } #Activated from effect

		available = {
			1028 = { has_border_war = no }
			408 = { has_border_war = no }
		}
		
		highlight_states = {
			highlight_state_targets = {
				state = 408
				state = 1028
			} 
		}

		ai_will_do = {
			base = 0
			modifier = {
				
			}
		}

		days_mission_timeout = 90
		is_good = no

		fire_only_once = yes #Reactivation handled in effect

		complete_effect = {

		}

		timeout_effect = {
			cancel_border_war = {
				defender = 408
				attacker = 1028
			}
			hidden_effect = {
				remove_targeted_decision = { target = SOV decision = JAP_border_conflict_escalate_conflict }
				remove_targeted_decision = { target = JAP decision = JAP_border_conflict_escalate_conflict }
			}
		}
	}

	#Decision to escalate conflict further
	JAP_border_conflict_escalate_conflict = {

		icon = generic_ignite_civil_war

		allowed = { always = no } #Activated from effect

		visible = {
			has_border_war_with = FROM
		}

		highlight_states = {
			highlight_state_targets = {
				state = 1028
				state = 408
			} 
		}

		cost = 200

		ai_will_do = {
			base = 0
			modifier = {
				add = 100 
				is_historical_focus_on = no 
			}
			modifier = {
				add = 50 
				AND = {
					tag = JAP 
					has_completed_focus = JAP_support_the_kodoha_faction
				}
			}
			modifier = {
				factor = 0
				has_war = yes 
			}
		}

		fire_only_once = yes #Reactivation handled in effect

		complete_effect = {
			if = {
				limit = { original_tag = SOV }
				set_border_war_data = {
					attacker = 1028
					defender = 408
					defender_modifier = 0.15
					combat_width = 100
				}
				JAP = {
					set_country_flag = {
						flag = WTT_border_conflict_escalate_to_war_cooldown
						days = 60
						value = 1
					}
					remove_targeted_decision = { target = SOV decision = JAP_border_conflict_escalate_conflict }
				}
				set_country_flag = {
					flag = WTT_border_conflict_escalate_to_war_cooldown
					days = 60
					value = 1
				}
				custom_effect_tooltip = in_60_days
				activate_targeted_decision = { target = JAP decision = JAP_border_conflict_escalate_to_war }
			}
			else = {
				set_border_war_data = {
					attacker = 1028
					defender = 408
					attacker_modifier = 0.15
					combat_width = 100
				}
				SOV = {
					set_country_flag = {
						flag = WTT_border_conflict_escalate_to_war_cooldown
						days = 60
						value = 1
					}
					remove_targeted_decision = { target = JAP decision = JAP_border_conflict_escalate_conflict }
				}
				set_country_flag = {
					flag = WTT_border_conflict_escalate_to_war_cooldown
					days = 60
					value = 1
				}
				custom_effect_tooltip = in_60_days
				activate_targeted_decision = { target = SOV decision = JAP_border_conflict_escalate_to_war }
			}
			
		}
	}

	#Decision to escalate conflict further
	JAP_border_conflict_escalate_to_war = {

		icon = generic_ignite_civil_war

		allowed = { always = no } #Activated from effect

		visible = {
			NOT = { has_country_flag = WTT_border_conflict_escalate_to_war_cooldown }
			has_border_war_with = FROM
		}
		cancel_trigger = {
			NOT = { has_border_war = yes }
		}

		highlight_states = {
 			highlight_state_targets = {
				state = 408
				state = 1028
			} 
		}

		cost = 150

		ai_will_do = {
			base = 0
			modifier = {
				add = 100 
				is_historical_focus_on = no 
			}
			modifier = {
				add = 50 
				AND = {
					tag = JAP 
					has_completed_focus = JAP_support_the_kodoha_faction
				}
			}
			modifier = {
				factor = 0
				has_war = yes 
			}
		}

		days_remove = 10

		fire_only_once = yes #Reactivation handled in effect

		war_with_target_on_remove = yes

		complete_effect = {
			if = {
				limit = { original_tag = SOV }
				408 = { save_event_target_as = their_state }
				1028 = { save_event_target_as = our_state }
				JAP = {
					country_event = { id = japan_border_conflict.6 hours = 1 }
					hidden_effect = {
						remove_targeted_decision = { target = SOV decision = JAP_border_conflict_escalate_to_war }
					}
			 	}
			}
			else = {
				1028 = { save_event_target_as = our_state }
				408 = { save_event_target_as = their_state }
				SOV = {
					country_event = { id = japan_border_conflict.5 hours = 1 }
					hidden_effect = {
						remove_targeted_decision = { target = JAP decision = JAP_border_conflict_escalate_to_war }
					}
			 	}
			}
			
		}

		remove_effect = {
			cancel_border_war = {
				dont_fire_events = yes
				defender = 408
				attacker = 1028
			}
			declare_war_on = { target = FROM type = annex_everything }
			if = {
				limit = { original_tag = SOV }
				1028 = {
					clr_state_flag = border_incident_active
				}
				408 = {
					clr_state_flag = border_incident_active
				}
				
			}
			else = {
				FROM = {
					1028 = {
						clr_state_flag = border_incident_active
					}
					408 = {
						clr_state_flag = border_incident_active
					}
				}
			}
		}
	}

	#Decision to back down from conflict
	JAP_border_conflict_back_out_of_conflict = {

		allowed = { always = no } #Activated from effect

		visible = {
			has_border_war_with = FROM
		}

		highlight_states = {
			highlight_state_targets = {
				state = 1028
				state = 408
			} 
		}

		ai_will_do = {
			base = 0
			modifier = {
				
			}
		}

		fire_only_once = yes #Reactivation handled in effect

		complete_effect = {
			if = {
				limit = { original_tag = SOV }
				finalize_border_war = {
					attacker_win = yes
					attacker = 1028
					defender = 408
				}
			}
			else = {
				finalize_border_war = {
					attacker = 1028
					defender = 408
					defender_win = yes
				}
			}
		}
	}

	JAP_war_with_soviet_union = {

		icon = generic_ignite_civil_war

		allowed = {
			original_tag = JAP
		}

		available = {

		}

		visible = {
			is_in_faction_with = GER
			GER = { has_completed_focus = GER_molotov_ribbentrop_pact }
			GER = { NOT = { has_war_with = SOV } }
			NOT = { has_war_with = SOV }
			has_completed_focus = JAP_preemptive_war
		}

		fire_only_once = yes


		modifier = {

		}

		days_remove = 0
		days_re_enable = 0

		cost = 25

		ai_will_do = {
			factor = 0
		}

		complete_effect = {
			declare_war_on = { target = SOV type = annex_everything }
			GER = { country_event = { id = wtt_japan.115 hours = 6 } }
		}		
	}

	### TAURAN INCIDENT ### 

	# Mission for tauran owner to escalate or incident is automatically lost
	JAP_tauran_border_incident_forgotten_1 = {

		icon = border_war

		allowed = { always = no } #Activated from effect

		visible = {
			has_global_flag = tauran_incident_has_begun_flag 
			OR = {
				AND = {
					owns_state = 761
					is_subject = no
				}
				AND = {
					any_subject_country = {
						owns_state = 761
					}
				}
			}
		}

		available = {
				
			OR = {
				has_border_war_with = MON # Japan/MAN shouldn't lose war support if they actually use the window of opportunity
				has_global_flag = initial_tauran_decision_taken_flag
			}
				
		}

		highlight_states = {
	 		highlight_state_targets = {
				state = 819
				state = 761
			} 
		}

		ai_will_do = {
			base = 0
		}

		days_mission_timeout = 30

		fire_only_once = yes

		is_good = no
		
		timeout_effect = {
			add_political_power = -25 
			add_war_support = -0.05 #Shameful Display
			MON = {
				country_event = {
					id = SEA_border_incidents_events.8
					days = 1
				}	
			}
			hidden_effect = {
				set_global_flag = failed_to_assault_in_time_flag
			}
		}
	}

	# First border incident
	JAP_assault_tauran_decision = {
		icon = border_war

		allowed = {
			OR = {
				original_tag = JAP
				original_tag = MAN
			}
		}

		visible = {
			OR = {
				AND = {
					761 = {
						is_owned_and_controlled_by = ROOT
					}
					is_subject = no
				}
				AND = {
					any_subject_country = {
						761 = {
							is_owned_and_controlled_by = PREV
						}
					}
				}
			}
			819 = {
				is_owned_and_controlled_by = MON
			}
			NOT = {
				has_global_flag = failed_to_assault_in_time_flag 
			}
			has_global_flag = tauran_incident_has_begun_flag 
		}

		available = {
			NOT = {
				has_war_with = MON
				is_in_faction_with = MON
				has_non_aggression_pact_with = MON
				MON = { is_puppet_of = ROOT }
			}
			761 = {
				any_neighbor_state = {
					is_controlled_by = MON
				}
			}
		}

		highlight_states = {
	 		highlight_state_targets = {
				state = 819
				state = 761
			} 
		}
		
		fire_only_once = yes

		ai_will_do = {
			base = 250
		}

		cost = 5

		days_remove = 30  

		war_with_on_remove = MON

		complete_effect = {
			761 = {
				save_event_target_as = MAN_MON_attacker_state
				set_state_flag = border_incident_active
			}
			819 = {
				save_event_target_as = MAN_MON_defender_state
				set_state_flag = border_incident_active
			}
			MON = {
				country_event = { id = SEA_border_incidents_events.4 days = 1 }
				activate_targeted_decision = { target = ROOT decision = JAP_tauran_border_conflict_warning_MON }
			}
			hidden_effect = {
				set_global_flag = initial_tauran_decision_taken_flag 
			}
		}
		remove_effect = {
			activate_targeted_decision = { target = MON decision = JAP_tauran_border_incident_forgotten }
			activate_targeted_decision = { target = MON decision = JAP_escalate_incident_to_border_conflict_MON }
		}
	}

	# Mission for defender warning that a conflict with FROM is coming
	JAP_tauran_border_conflict_warning_MON = {

		icon = border_war

		allowed = { always = no } #Activated from effect

		available = {
			hidden_trigger = { always = no }
		}

		war_with_target_on_timeout = yes

		ai_will_do = {
			base = 0
			modifier = {
				
			}
		}

		days_mission_timeout = 30 

		fire_only_once = yes

		is_good = no
		
		timeout_effect = {
			custom_effect_tooltip = escalation_possible_tooltip_for_defender
			custom_effect_tooltip = effects_if_border_conflict_is_lost
			effect_tooltip = {
				add_war_support = -0.05
				add_political_power = -50
			}
			hidden_effect = {
				IF = {
					limit = {
						761 = {
							is_owned_and_controlled_by = MAN
						}
						MAN = {
							is_subject = no
						}
					}
					remove_targeted_decision = { target = MAN decision = JAP_tauran_border_conflict_warning_MON }
					activate_targeted_decision = { target = MAN decision = JAP_border_conflict_escalation_warning_MON }
				}
				ELSE_IF = {
					limit = {
						761 = {
							is_owned_and_controlled_by = MAN
						}
						MAN = {
							is_subject_of = JAP
						}
					}
					remove_targeted_decision = { target = JAP decision = JAP_tauran_border_conflict_warning_MON }
					activate_targeted_decision = { target = JAP decision = JAP_border_conflict_escalation_warning_MON }
				}
				ELSE_IF = {
					limit = {
						761 = {
							is_owned_and_controlled_by = JAP
						}
					}
					remove_targeted_decision = { target = JAP decision = JAP_tauran_border_conflict_warning_MON }
					activate_targeted_decision = { target = JAP decision = JAP_border_conflict_escalation_warning_MON }
				}
			}
		}
	}

	# Mission for defender warning FROM can escalate to war at any point is coming
	JAP_border_conflict_escalation_warning_MON = {

		icon = border_war

		allowed = { always = no } #Activated from effect
		visible = { 
			hidden_trigger = { 
				NOT = { 
					has_border_war_with = JAP 
					has_border_war_with = MAN 
				} 
			} 
		}
		cancel_if_not_visible = yes 

		available = {
			#var:ROOT.defender_state_vs_@FROM = {
			#	has_ROOT_at_least_1_div_in_current_state_scope = yes
			#}
			hidden_trigger = { always = no }
		}

		war_with_target_on_timeout = yes
		ai_will_do = {
			base = 0
			modifier = {
				
			}
		}

		days_mission_timeout = 30

		fire_only_once = yes

		is_good = no

		timeout_effect = {
			custom_effect_tooltip = from_cannot_escalate
			custom_effect_tooltip = effects_if_border_conflict_is_lost
			effect_tooltip = {
				add_war_support = -0.05
				add_political_power = -50
			}
		}		
	}

	# Mission for attacker to escalate or incident is forgotten
	JAP_tauran_border_incident_forgotten = {

		icon = border_war

		allowed = { always = no } #Activated from effect

		available = {
			
			hidden_trigger = {
				OR = {
					has_border_war_with = MON # Japan shouldn't lose war support if they actually use the window of opportunity
					has_global_flag = JAP_did_the_tauran_border_war_flag
				}
			}
				
		}

		highlight_states = {
			highlight_state_targets = {
				state = 819 
				state = 761
			} 
		}

		ai_will_do = {
			base = 0
			modifier = {
				
			}
		}

		days_mission_timeout = 30

		fire_only_once = yes

		is_good = no
		
		timeout_effect = {
			remove_targeted_decision = { target = MON decision = JAP_escalate_incident_to_border_conflict_MON }
			add_political_power = -50
			add_war_support = -0.05 #Shameful Display
			MON = {
				country_event = {
					id = SEA_border_incidents_events.8
					days = 1
				}	
			}
			hidden_effect = {
				MON = { remove_targeted_decision = { target = ROOT decision = JAP_border_conflict_escalation_warning_MON } }
				MON = {
					761 = {
						clr_state_flag = border_incident_active
					}
					819 = {
						clr_state_flag = border_incident_active
					}
				}
			}
		}
	}

	#Decision to escalate incident on border with MON to border conflict
	JAP_escalate_incident_to_border_conflict_MON = {

		icon = border_war

		allowed = { always = no } #Activated from effect

		available = {
			761 = {
				OR = {
					is_fully_controlled_by = ROOT
					CONTROLLER = {
						is_subject_of = ROOT
					}
					CONTROLLER = {
						is_in_faction_with = ROOT
					}
				}
			}
			divisions_in_border_state = {
				state = 761
				border_state = 819
				size > 0
			}
		}

		highlight_states = {
			highlight_state_targets = {
				state = 761
				state = 819	
			} 
		}

		ai_will_do = {
			base = 25 
			modifier = { 
				has_war = no
				factor = 10
			}
		}

		fire_only_once = yes #Reactivation handled in effect

		complete_effect = {
			remove_targeted_decision = { target = MON decision = JAP_tauran_border_incident_forgotten }
			activate_mission = JAP_tauran_border_conflict_time_until_cancelled
			start_border_war = {
				change_state_after_war = no
				attacker = {
					state = 761
					num_provinces = 4
					on_win = SEA_border_incidents_events.5
					on_lose = SEA_border_incidents_events.6
					on_cancel = SEA_border_incidents_events.7
				}
				
				defender = {
					state = 819
					num_provinces = 4
					on_win = SEA_border_incidents_events.6
					on_lose = SEA_border_incidents_events.5
					on_cancel = SEA_border_incidents_events.7
				}
			}
		}
	}

	#Mission for attacker to win border war against FROM in X days
	JAP_tauran_border_conflict_time_until_cancelled = {

		icon = border_war

		allowed = { always = no } #Activated from effect

		available = {
			819 = { has_border_war = no }
			761 = { has_border_war = no }
		}
		
		highlight_states = {
			highlight_state_targets = {
				state = 819
				state = 761
			} 
		}

		ai_will_do = {
			base = 0
			modifier = {
				
			}
		}

		days_mission_timeout = 90
		is_good = no

		fire_only_once = yes #Reactivation handled in effect

		complete_effect = {

		}

		timeout_effect = {
			cancel_border_war = {
				defender = 819
				attacker = 761
			}
		}
	}

}

prospect_for_resources = {

#  #  ##  ###  ### #  # ### ###  #  #     ###  ###  ##  ##  #  # ###   ##  ###      ##  ###  ###  ##  
## # #  # #  #  #  #  # #   #  # ## #     #  # #   #   #  # #  # #  # #  # #       #  # #  # #   #  # 
# ## #  # ###   #  #### ##  ###  # ##     ###  ##   #  #  # #  # ###  #    ##      #### ###  ##  #### 
#  # #  # #  #  #  #  # #   #  # #  #     #  # #     # #  # #  # #  # #  # #       #  # #  # #   #  # 
#  #  ##  #  #  #  #  # ### #  # #  #     #  # ### ##   ##   ##  #  #  ##  ###     #  # #  # ### #  # 

	#Below is visible when JAP_establish_the_northern_resource_area is completed
	JAP_develop_north_sakhalin_oil_deposits = { #655
		icon = oil

		highlight_states = {
 			highlight_state_targets = {
				state = 655
			} 
		}

		allowed = {
			original_tag = JAP
		}

		available = {
			655 = { is_controlled_by_ROOT_or_subject = yes }
			has_tech = excavation2
		}

		visible = {
			OR = {
				has_completed_focus = JAP_establish_the_northern_resource_area
				has_completed_focus = JAP_sea_establish_the_northern_resource_area
				has_completed_focus = JAP_transformation_of_nature
			}
		}

		fire_only_once = no

		cancel_trigger = {
			655 = { is_controlled_by_ROOT_or_subject = no }
		}

		cost = 25
		days_remove = 60

		modifier = {
			civilian_factory_use = 3
		}

		ai_will_do = {
			base = 10
		}

		remove_effect = {
			655 = {
				add_resource = {
					type = oil
					amount = 12
				}
			}
		}
	}

	# Develop Tunguska Coal Deposits
	JAP_develop_tunguska_coal_deposits = { #516
		icon = coal

		highlight_states = {
 			highlight_state_targets = {
				state = 516
			} 
		}

		allowed = {
			original_tag = JAP
		}

		available = {
			516 = { is_controlled_by_ROOT_or_subject = yes }
			has_tech = excavation1
		}

		visible = {
			OR = {
				has_completed_focus = JAP_establish_the_northern_resource_area
				has_completed_focus = JAP_sea_establish_the_northern_resource_area
				has_completed_focus = JAP_transformation_of_nature
			}
			516 = {
				NOT = {
					has_state_flag = tunguska_coal_developed
				}
			}
		}

		fire_only_once = no

		cancel_trigger = {
			516 = { is_controlled_by_ROOT_or_subject = no }
		}

		cost = 25
		days_remove = 60

		modifier = {
			civilian_factory_use = 3
		}

		ai_will_do = {
			base = 10
		}

		remove_effect = {
			516 = {
				add_resource = {
					type = coal
					amount = 26
				}
				set_state_flag = tunguska_coal_developed
			}
		}
	}

	# Develop Irkutsk Coal Deposits
	JAP_develop_irkutsk_coal_deposits = { #566
		icon = coal

		highlight_states = {
 			highlight_state_targets = {
				state = 566
			} 
		}

		allowed = {
			original_tag = JAP
		}

		available = {
			566 = { is_controlled_by_ROOT_or_subject = yes }
			has_tech = excavation1
		}

		visible = {
			OR = {
				has_completed_focus = JAP_establish_the_northern_resource_area
				has_completed_focus = JAP_sea_establish_the_northern_resource_area
				has_completed_focus = JAP_transformation_of_nature
			}
			566 = {
				NOT = {
					has_state_flag = irkutsk_coal_developed
				}
			}
		}

		fire_only_once = no

		cancel_trigger = {
			566 = { is_controlled_by_ROOT_or_subject = no }
		}

		cost = 25
		days_remove = 60

		modifier = {
			civilian_factory_use = 3
		}

		ai_will_do = {
			base = 10
		}

		remove_effect = {
			566 = {
				add_resource = {
					type = coal
					amount = 20
				}
				set_state_flag = irkutsk_coal_developed
			}
		}
	}


 ##  ##  #  # ### #  # ### ###  #  #     ###  ###  ##  ##  #  # ###   ##  ###      ##  ###  ###  ##  
#   #  # #  #  #  #  # #   #  # ## #     #  # #   #   #  # #  # #  # #  # #       #  # #  # #   #  # 
 #  #  # #  #  #  #### ##  ###  # ##     ###  ##   #  #  # #  # ###  #    ##      #### ###  ##  #### 
  # #  # #  #  #  #  # #   #  # #  #     #  # #     # #  # #  # #  # #  # #       #  # #  # #   #  # 
##   ##   ##   #  #  # ### #  # #  #     #  # ### ##   ##   ##  #  #  ##  ###     #  # #  # ### #  # 

#623:0 "Luzon"
#627:0 "Mindanao"
#625:0 "Samar"
#725:0 "Nauru"

	#Below is visible when JAP_exploit_the_southern_resource_area is completed
	JAP_develop_luzon_chromium_deposits = { #623
		icon = chromium

		highlight_states = {
 			highlight_state_targets = {
				state = 623
			} 
		}

		allowed = {
			original_tag = JAP
		}

		available = {
			623 = { is_controlled_by_ROOT_or_subject = yes }
			has_tech = excavation3
		}

		visible = {
			OR = {
				has_completed_focus = JAP_transformation_of_nature
				has_completed_focus = JAP_sea_exploit_southern_resource_area
			}
			623 = {
				NOT = {
					has_state_flag = luzon_chromium_developed
				}
			}
		}

		fire_only_once = no

		cancel_trigger = {
			623 = { is_controlled_by_ROOT_or_subject = no }
		}

		cost = 25
		days_remove = 60

		modifier = {
			civilian_factory_use = 3
		}

		ai_will_do = {
			base = 10
		}

		remove_effect = {
			623 = {
				add_resource = {
					type = chromium
					amount = 12
				}
				set_state_flag = luzon_chromium_developed
			}
		}
	}

	JAP_develop_mindanao_steel_deposits = { #627
		icon = steel

		highlight_states = {
 			highlight_state_targets = {
				state = 627
			} 
		}

		allowed = {
			original_tag = JAP
		}

		available = {
			627 = { is_controlled_by_ROOT_or_subject = yes }
			has_tech = excavation4
		}

		visible = {
			OR = {
				has_completed_focus = JAP_transformation_of_nature
				has_completed_focus = JAP_sea_exploit_southern_resource_area
			}
			627 = {
				NOT = {
					has_state_flag = mindanao_steel_developed
				}
			}
		}

		fire_only_once = no

		cancel_trigger = {
			627 = { is_controlled_by_ROOT_or_subject = no }
		}

		cost = 25
		days_remove = 60

		modifier = {
			civilian_factory_use = 3
		}

		ai_will_do = {
			base = 10
		}

		remove_effect = {
			627 = {
				add_resource = {
					type = steel
					amount = 8
				}
				set_state_flag = mindanao_steel_developed
			}
		}
	}

	JAP_develop_samar_steel_deposits = { #625
		icon = steel

		highlight_states = {
 			highlight_state_targets = {
				state = 625
			} 
		}

		allowed = {
			original_tag = JAP
		}

		available = {
			625 = { is_controlled_by_ROOT_or_subject = yes }
			has_tech = excavation3
		}

		visible = {
			OR = {
				has_completed_focus = JAP_transformation_of_nature
				has_completed_focus = JAP_sea_exploit_southern_resource_area
			}
			625 = {
				NOT = {
					has_state_flag = samar_steel_developed
				}
			}
		}

		fire_only_once = no

		cancel_trigger = {
			625 = { is_controlled_by_ROOT_or_subject = no }
		}

		cost = 25
		days_remove = 60

		modifier = {
			civilian_factory_use = 3
		}

		ai_will_do = {
			base = 10
		}

		remove_effect = {
			625 = {
				add_resource = {
					type = steel
					amount = 6
				}
				set_state_flag = samar_steel_developed
			}
		}
	}

	JAP_develop_nauru_tungsten_deposits = { #725
		icon = tungsten

		allowed = {
			original_tag = JAP
		}

		highlight_states = {
 			highlight_state_targets = {
				state = 725
			} 
		}

		available = {
			725 = { is_controlled_by_ROOT_or_subject = yes }
			has_tech = excavation4
		}

		visible = {
			OR = {
				has_completed_focus = JAP_transformation_of_nature
				has_completed_focus = JAP_sea_exploit_southern_resource_area
			}
			725 = {
				NOT = {
					has_state_flag = nauru_tungsten_developed
				}
			}
		}

		fire_only_once = no

		cancel_trigger = {
			725 = { is_controlled_by_ROOT_or_subject = no }
		}

		cost = 25
		days_remove = 60

		modifier = {
			civilian_factory_use = 3
		}

		ai_will_do = {
			base = 1
		}

		remove_effect = {
			725 = {
				add_resource = {
					type = tungsten
					amount = 4
				}
				set_state_flag = nauru_tungsten_developed
			}
		}
	}

	#JAP_develop_tonkin_aluminium_deposits = { #671
	#	icon = aluminium
	#	
	#	allowed = {
	#		original_tag = JAP
	#	}
#
	#	highlight_states = {
 	#		highlight_state_targets = {
	#			state = 671
	#		} 
	#	}
#
	#	available = {
	#		671 = { is_controlled_by_ROOT_or_subject = yes }
	#		has_tech = excavation4
	#	}
#
	#	visible = {
	#		OR = {
	#			has_completed_focus = JAP_sea_exploit_southern_resource_area
	#			has_completed_focus = JAP_exploit_the_southern_resource_area
	#		}
	#		671 = {
	#			NOT = {
	#				has_state_flag = tonkin_aluminium_developed
	#			}
	#		}
	#	}
#
	#	fire_only_once = no
#
	#	cancel_trigger = {
	#		671 = { is_controlled_by_ROOT_or_subject = no }
	#	}
#
	#	cost = 25
	#	days_remove = 60
#
	#	modifier = {
	#		civilian_factory_use = 3
	#	}
#
	#	ai_will_do = {
	#		base = 1
	#	}
#
	#	remove_effect = {
	#		671 = {
	#			add_resource = {
	#				type = aluminium
	#				amount = 6
	#			}
	#			set_state_flag = tonkin_aluminium_developed
	#		}
	#	}
	#}

	JAP_develop_singapore_aluminium_deposits = { #1021
		icon = aluminium
		
		allowed = {
			original_tag = JAP
		}

		highlight_states = {
 			highlight_state_targets = {
				state = 1021
			} 
		}

		available = {
			1021 = { is_controlled_by_ROOT_or_subject = yes }
			has_tech = excavation2
		}

		visible = {
			OR = {
				has_completed_focus = JAP_transformation_of_nature
				has_completed_focus = JAP_sea_exploit_southern_resource_area
			}
			1021 = {
				NOT = {
					has_state_flag = singapore_aluminium_developed
				}
			}
		}

		fire_only_once = no

		cancel_trigger = {
			1021 = { is_controlled_by_ROOT_or_subject = no }
		}

		cost = 25
		days_remove = 60

		modifier = {
			civilian_factory_use = 3
		}

		ai_will_do = {
			base = 1
		}

		remove_effect = {
			1021 = {
				add_resource = {
					type = aluminium
					amount = 12
				}
				set_state_flag = singapore_aluminium_developed
			}
		}
	}

	JAP_develop_riau_oil_deposits = { #672
		icon = oil

		highlight_states = {
 			highlight_state_targets = {
				state = 672
			} 
		}

		allowed = {
			original_tag = JAP
		}

		available = {
			672 = { is_controlled_by_ROOT_or_subject = yes }
			has_tech = excavation3
		}

		visible = {
			OR = {
				has_completed_focus = JAP_transformation_of_nature
				has_completed_focus = JAP_sea_exploit_southern_resource_area
			}
			672 = {
				NOT = {
					has_state_flag = riau_oil_developed
				}
			}
		}

		fire_only_once = no

		cancel_trigger = {
			672 = { is_controlled_by_ROOT_or_subject = no }
		}

		cost = 50
		days_remove = 60

		modifier = {
			civilian_factory_use = 5
		}

		ai_will_do = {
			base = 10
		}

		remove_effect = {
			672 = {
				add_resource = {
					type = oil
					amount = 26
				}
				set_state_flag = riau_oil_developed
			}
		}
	}

	JAP_develop_kalimantan_oil_deposits = { #334
		icon = oil

		highlight_states = {
 			highlight_state_targets = {
				state = 334
			} 
		}

		allowed = {
			original_tag = JAP
		}

		available = {
			334 = { is_controlled_by_ROOT_or_subject = yes }
			has_tech = excavation3
		}

		visible = {
			OR = {
				has_completed_focus = JAP_transformation_of_nature
				has_completed_focus = JAP_sea_exploit_southern_resource_area
			}
			334 = {
				NOT = {
					has_state_flag = kalimantan_oil_developed
				}
			}
		}

		fire_only_once = no

		cancel_trigger = {
			334 = { is_controlled_by_ROOT_or_subject = no }
		}

		cost = 25
		days_remove = 60

		modifier = {
			civilian_factory_use = 3
		}

		ai_will_do = {
			base = 10
		}

		remove_effect = {
			334 = {
				add_resource = {
					type = oil
					amount = 16
				}
				set_state_flag = kalimantan_oil_developed
			}
		}
	}

	JAP_develop_west_papuan_oil_deposits = { #669
		icon = oil

		highlight_states = {
 			highlight_state_targets = {
				state = 669
			} 
		}

		allowed = {
			original_tag = JAP
		}

		available = {
			669 = { is_controlled_by_ROOT_or_subject = yes }
			has_tech = excavation3
		}

		visible = {
			OR = {
				has_completed_focus = JAP_transformation_of_nature
				has_completed_focus = JAP_sea_exploit_southern_resource_area
			}
			669 = {
				NOT = {
					has_state_flag = west_papuan_oil_developed
				}
			}
		}

		fire_only_once = no

		cancel_trigger = {
			669 = { is_controlled_by_ROOT_or_subject = no }
		}

		cost = 25
		days_remove = 60

		modifier = {
			civilian_factory_use = 5
		}

		ai_will_do = {
			base = 10
		}

		remove_effect = {
			669 = {
				add_resource = {
					type = oil
					amount = 14
				}
				set_state_flag = west_papuan_oil_developed
			}
		}
	}

	JAP_develop_tuban_oil_deposits = { #335
		icon = oil

		highlight_states = {
 			highlight_state_targets = {
				state = 335
			} 
		}

		allowed = {
			original_tag = JAP
		}

		available = {
			335 = { is_controlled_by_ROOT_or_subject = yes }
			has_tech = excavation5
		}

		visible = {
			OR = {
				has_completed_focus = JAP_transformation_of_nature
				has_completed_focus = JAP_sea_exploit_southern_resource_area
			}
			335 = {
				NOT = {
					has_state_flag = tuban_oil_developed
				}
			}
		}

		fire_only_once = no

		cancel_trigger = {
			335 = { is_controlled_by_ROOT_or_subject = no }
		}

		cost = 30
		days_remove = 60

		modifier = {
			civilian_factory_use = 3
		}

		ai_will_do = {
			base = 10
		}

		remove_effect = {
			335 = {
				add_resource = {
					type = oil
					amount = 12
				}
				set_state_flag = tuban_oil_developed
			}
		}
	}




 ##  #  # ### #  # ###  ## ###     ###  ###  ##  ##  #  # ###   ##  ###  ## 
#  # #  #  #  ## # #   #   #       #  # #   #   #  # #  # #  # #  # #   #   
#    ####  #  # ## ##   #  ##      ###  ##   #  #  # #  # ###  #    ##   #  
#  # #  #  #  #  # #     # #       #  # #     # #  # #  # #  # #  # #     # 
 ##  #  # ### #  # ### ##  ###     #  # ### ##   ##   ##  #  #  ##  ### ##  

#597:0 "Shandong"
#621:0 "Suiyuan"

	#Below is visible when JAP_develop_chinese_resources is completed
	JAP_develop_shandong_aluminium_deposits = { #597
		
		icon = aluminium

		highlight_states = {
 			highlight_state_targets = {
				state = 597
			} 
		}

		allowed = {
			original_tag = JAP
		}

		available = {
			597 = { is_controlled_by_ROOT_or_subject = yes }
			has_tech = excavation3
		}

		visible = {
			OR = {
				has_completed_focus = JAP_transformation_of_nature
				has_completed_focus = JAP_develop_the_chinese_resources
			}
			
			597 = {
				NOT = {
					has_state_flag = shandong_aluminium_developed
				}
			}
		}

		fire_only_once = no

		cancel_trigger = {
			597 = { is_controlled_by_ROOT_or_subject = no }
		}

		cost = 25
		days_remove = 60

		modifier = {
			civilian_factory_use = 3
		}

		ai_will_do = {
			base = 1
		}

		complete_effect = {
			597 = {
				add_resource = {
					type = aluminium
					amount = 12
				}
				set_state_flag = shandong_aluminium_developed
			}
		}
	}

	JAP_develop_suiyuan_steel_deposits = { #621
		
		icon = steel

		highlight_states = {
 			highlight_state_targets = {
				state = 621
			} 	
		}

		allowed = {
			original_tag = JAP
		}

		available = {
			621 = { is_controlled_by_ROOT_or_subject = yes }
			has_tech = excavation2
		}

		visible = {
			OR = {
				has_completed_focus = JAP_transformation_of_nature
				has_completed_focus = JAP_develop_the_chinese_resources
			}
			
			621 = {
				NOT = {
					has_state_flag = suiyuan_steel_developed
				}
			}
		}

		fire_only_once = no

		cancel_trigger = {
			621 = { is_controlled_by_ROOT_or_subject = no }
		}

		cost = 25
		days_remove = 60

		modifier = {
			civilian_factory_use = 3
		}

		ai_will_do = {
			base = 10
		}

		complete_effect = {
			621 = {
				add_resource = {
					type = steel
					amount = 8
				}
				set_state_flag = suiyuan_steel_developed
			}
		}	
	}

	JAP_develop_yunnan_aluminium_deposits = { #325

		icon = aluminium
		
		allowed = {
			original_tag = JAP
		}

		available = {
			325 = { is_controlled_by_ROOT_or_subject = yes }
			has_tech = excavation3
		}

		visible = {
			OR = {
				has_completed_focus = JAP_transformation_of_nature
				has_completed_focus = JAP_develop_the_chinese_resources
			}
			
			325 = {
				NOT = {
					has_state_flag = yunnan_aluminium_developed
				}
			}
		}

		fire_only_once = no

		cancel_trigger = {
			325 = { is_controlled_by_ROOT_or_subject = no }
		}

		cost = 25
		days_remove = 60

		modifier = {
			civilian_factory_use = 3
		}

		ai_will_do = {
			base = 1
		}

		complete_effect = {
			325 = {
				add_resource = {
					type = aluminium
					amount = 12
				}
				set_state_flag = yunnan_aluminium_developed
			}
		}	
	}

	JAP_develop_sichuan_aluminium_deposits = { #605

		icon = aluminium
		
		allowed = {
			original_tag = JAP
		}

		available = {
			605 = { is_controlled_by_ROOT_or_subject = yes }
			has_tech = excavation3
		}

		visible = {
			OR = {
				has_completed_focus = JAP_transformation_of_nature
				has_completed_focus = JAP_develop_the_chinese_resources
			}
			
			605 = {
				NOT = {
					has_state_flag = sichuan_aluminium_developed
				}
			}
		}

		fire_only_once = no

		cancel_trigger = {
			605 = { is_controlled_by_ROOT_or_subject = no }
		}

		cost = 25
		days_remove = 60

		modifier = {
			civilian_factory_use = 3
		}

		ai_will_do = {
			base = 1
		}

		complete_effect = {
			605 = {
				add_resource = {
					type = aluminium
					amount = 12
				}
				set_state_flag = sichuan_aluminium_developed
			}
		}	
	}

}


# The Imperial Way
JAP_kodoha_insurgency_decisions = {
	
	### MISSIONS ###
	
	# Saburō Aizawa's Trial Ongoing
	JAP_aizawa_trial_ongoing = {

		priority = 100

		icon = GFX_decision_generic_police_action 

		allowed = {
			original_tag = JAP
		}

		visible = {
			has_civil_war = no
			has_government = neutrality
			date>1935.12.31			
			hidden_trigger = {
				NOT = {
					has_country_flag = JAP_aizawas_trial_over_flag
					hidden_trigger = {
						has_country_flag = JAP_1939_start_date_initiated
					}
				}
			}
		}

		available = {
			hidden_trigger = { always = no }
		}

		days_mission_timeout = 56 # Should timeout on Feb 25, so the coup d'etat can fire on the 26th

		fire_only_once = yes

		activation = {
			date>1935.12.31
			original_tag = JAP
		}

		cancel_if_not_visible = yes

		is_good = no

		timeout_effect = {

			country_event = {
				id = SEA_japan.1
				hours = 6
			}	
			custom_effect_tooltip = JAP_aizawa_trial_ongoing_tt

		}

	}

	### DECISIONS ###

	# Increase Security Around Takahashi Korekiyo
	JAP_increase_takahashi_korekiyo_security_decision  = {

		priority = 80

		icon = GFX_decision_SWI_no_elected_president

		ai_will_do = {
			base = 0
			modifier = {
				add = 100
				OR = {
					has_country_flag = JAP_AI_RANDOM_DEMOCRATIC
					has_game_rule = {
						rule = JAP_ai_behavior
						option = DEMOCRATIC
					}
				}
			}
		}

		allowed = {  
		}

		visible = { 
			has_active_mission = JAP_aizawa_trial_ongoing # This is to make it dissappear afterwards
			has_country_flag = JAP_can_now_save_advisors_flag
		}

		available = {
			has_active_mission = JAP_aizawa_trial_ongoing # This is to show that it will dissappear afterwards
		}

		fire_only_once = yes

		cost = 40

		complete_effect = {

			custom_effect_tooltip = JAP_increase_takahashi_korekiyo_security_decision_tt

			custom_effect_tooltip = generic_skip_one_line_tt

			custom_effect_tooltip = JAP_will_not_impact_focus_choices_tt

			custom_effect_tooltip = generic_skip_one_line_tt

			show_ideas_tooltip = JAP_takahashi_korekiyo

			hidden_effect = {
				set_country_flag = JAP_korekiyo_protected_flag
			}

		}

		remove_effect = {
		}

	}

	# Increase Security Around Jōtarō Watanabe
	JAP_increase_jotaro_watanabe_security_decision  = {

		priority = 70

		icon = GFX_decision_generic_belgian_colonial_helmet

		ai_will_do = {
			base = 0
			modifier = {
				add = 10
				OR = {
					has_country_flag = JAP_AI_RANDOM_DEMOCRATIC
					has_game_rule = {
						rule = JAP_ai_behavior
						option = DEMOCRATIC
					}
				}
			}
		}

		allowed = {  
		}

		visible = { 
			has_active_mission = JAP_aizawa_trial_ongoing # This is to make it dissappear afterwards
			has_country_flag = JAP_can_now_save_advisors_flag
		}

		available = {
			has_active_mission = JAP_aizawa_trial_ongoing # This is to show that it will dissappear afterwards
		}

		fire_only_once = yes

		cost = 40

		complete_effect = {

			custom_effect_tooltip = JAP_increase_jotaro_watanabe_security_decision_tt

			custom_effect_tooltip = generic_skip_one_line_tt

			custom_effect_tooltip = JAP_will_not_impact_focus_choices_tt

			custom_effect_tooltip = generic_skip_one_line_tt

			show_ideas_tooltip = JAP_jotaro_watanabe

			hidden_effect = {
				set_country_flag = JAP_watanabe_protected_flag
			}

		}

		#modifier = {
		#	command_power_gain = -0.2
		#}

		remove_effect = {
		}

	}

}

# The Kwantung Army
JAP_kwantung_army_decisions = {
	
	### MISSIONS ###
	
	# Kwantung Army Growing Impatient
	JAP_kwantung_army_impatience = {

		priority = 100

		icon = GFX_decision_jap_conquer_china #GFX_decision_generic_ignite_civil_war

		available = {
			hidden_trigger = { always = no }
		}

		days_mission_timeout = JAP.kwantung_army_timeout_time_var # 725, Should timeout about half a year after the historical Marco Polo Bridge Incident

		fire_only_once = yes

		activation = {
			always = no
		}

		visible = {
			original_tag = JAP
			has_civil_war = no
			is_subject = no 
			NOT = { has_war_with = CHI }
			NOT = {
				has_completed_focus = JAP_subdue_the_kwantung_army
			}
		}

		cancel_if_not_visible = yes

		is_good = no

		timeout_effect = {

			IF = {
				limit = {
					OR = {
						HBC = {
							OR = {
								controls_state = 608
								controls_state = 614
							}
						}
						XIC = {
							OR = {
								controls_state = 608
								controls_state = 614
							}
						}
						CHI = { #if CHI owns one of these states, they get the event
							OR = {
								controls_state = 608
								controls_state = 614
								controls_state = 743 
							}
						}
					}	
				}
				CHI = {
					country_event = {
						id = china.1
						days = 1
						random_days = 3
					}	
				}
			}
			ELSE_IF = {
				limit = {
					PRC = { #only fires the event for PRC if they control ALL of the states (to ensure that only one of them gets it, to avoid issues when one selects to turn over the states and the other doesn't)
						AND = {
							controls_state = 608
							controls_state = 614
						}
					}
				}
				PRC = {
					country_event = {
						id = china.1
						days = 1
						random_days = 3
					}	
				}
			}
			ELSE_IF = {
				limit = {
					SHX = { #only fires the event for SHX if they control ALL of the states (to ensure that only one of them gets it, to avoid issues when one selects to turn over the states and the other doesn't)
						AND = {
							controls_state = 608
							controls_state = 614
						}
					}
				}
				SHX = {
					country_event = {
						id = china.1
						days = 1
						random_days = 3
					}	
				}
			}
			ELSE_IF = {
				limit = {
					SND = { #only fires the event for SND if they control ALL of the states (to ensure that only one of them gets it, to avoid issues when one selects to turn over the states and the other doesn't)
						AND = {
							controls_state = 608
							controls_state = 597
							controls_state = 614
						}
					}
				}
				SND = {
					country_event = {
						id = china.1
						days = 1
						random_days = 3
					}	
				}
			}
			ELSE = {
				608 = {
					OWNER = {
						country_event = {
							id = china.1
							days = 1
							random_days = 3
						}
					}
				}
			}
			add_named_threat = { threat = 2 name = JAP_intervene_in_china } # From threat = 1 to 2 due to no escalation tension

			hidden_effect = {
				set_country_flag = JAP_kwantung_army_went_in_on_china
			}

		}

	}

	# The Suiyuan Campaign
	JAP_the_suiyuan_offensive_mission = {

		priority = 100

		icon = GFX_decision_generic_operation

		available = {
			hidden_trigger = { always = no }
		}

		days_mission_timeout = 56 # Historically went from October 1936 to 19 December 1936

		fire_only_once = yes

		activation = {
			always = no
		}

		visible = {
			original_tag = JAP
			has_civil_war = no
			is_subject = no 
			NOT = { has_war_with = CHI }
			has_war_with = SHX
			has_subject = MEN
		}

		cancel_if_not_visible = yes

		is_good = no

		timeout_effect = {

			custom_effect_tooltip = JAP_the_suiyuan_offensive_mission_tt

			country_event = {
				id = SEA_japan_foreign_policy.29
				hours = 6
			}	

			hidden_effect = {
				clr_country_flag = JAP_suiyuan_campaign_has_started_flag
				set_country_flag = JAP_suiyuan_campaign_has_ended_flag
			}

		}

	}

	# Growing Unrest in the Shanghai Concession
	JAP_growing_unrest_in_the_shanghai_concession = {

		priority = 100

		icon = GFX_decision_jap_conquer_china #GFX_decision_generic_ignite_civil_war

		available = {
			hidden_trigger = { always = no }
		}

		days_mission_timeout = 365

		fire_only_once = yes

		activation = {
			always = no
		}

		visible = {
			original_tag = JAP
			has_civil_war = no
			is_subject = no 
			NOT = { has_war_with = CHI }
			NOT = {
				has_completed_focus = JAP_subdue_the_kwantung_army
			}
			613 = {
				OWNER = {
					is_literally_china = yes
					NOT = {
						is_ally_with = ROOT
						has_war_with = ROOT # In case someone other than CHI owns this for example 
					}
				}
			}
		}

		cancel_if_not_visible = yes

		is_good = no

		timeout_effect = {

			IF = {
				limit = {
					CHI = { #if CHI owns the state, they get the event
						controls_state = 613
					}
				}
				CHI = {
					country_event = {
						id = SEA_japan_popup_events.19
						days = 1
						random_days = 3
					}	
				}
			}
			ELSE_IF = {
				limit = {
					PRC = {
						controls_state = 613
					}
				}
				PRC = {
					country_event = {
						id = SEA_japan_popup_events.19
						days = 1
						random_days = 3
					}	
				}
			}
			ELSE = {
				613 = {
					OWNER = {
						country_event = {
							id = SEA_japan_popup_events.19
							days = 1
							random_days = 3
						}	
					}
				}
			}
			add_named_threat = { threat = 3 name = JAP_shanghai_ultimatum } 

			hidden_effect = {
				set_country_flag = JAP_post_marco_polo_event_triggered_flag 
			}

		}

	}

	### DECISIONS ###

	# Strike Down [FROM.GetNameDef]
	JAP_strike_down_chinese_warlord_decision  = {

		priority = 10

		icon = GFX_decision_border_war

		target_root_trigger = { original_tag = JAP }

		target_trigger = {
			#Target is FROM
			FROM = {
				is_literally_china = yes
				NOT = {
					is_ally_with = ROOT
					has_war_with = ROOT
				}
			}
		}

		ai_will_do = {
			base = 50
			modifier = {
				factor = 0
				FROM = {
					any_allied_country = {
						is_major = yes
						NOT = {
							has_war_with = ROOT
						}
					}
				}
			}
		}
	
		allowed = {  
			original_tag = JAP 
		}

		visible = { 
			OR = {
				has_subject = RNG
				has_subject = CHI
				AND = {
					has_completed_focus = JAP_subdue_the_kwantung_army
					owns_state = 613 # Shanghai
				}
			}
			has_completed_focus = JAP_reorganized_national_government
			OR = {
				has_government = neutrality
				has_government = fascism
			}
		}
	
		available = {
			
		}

		days_remove = 35

		#days_re_enable = 70

		cost = 30

		#war_with_on_remove = FROM

		cancel_trigger = {
		}

        cancel_effect = {
        }

		modifier = {
		}

		complete_effect = { 
	

		}

		fire_only_once = yes

		remove_effect = {

			IF = {
				limit = {
					has_subject = RNG
				}
				FROM = {
					every_core_state = {
						add_claim_by = RNG
					}
				}
				custom_effect_tooltip = generic_skip_one_line_tt
			}

			create_wargoal = {
				type = annex_everything
				target = FROM
			}

		}

	}

	# Launch an Offensive in [FROM.GetNameDef]
	JAP_launch_an_offensive_in_chinese_state_decision  = {

		priority = 5

		icon = GFX_decision_border_war

		highlight_states = {
			highlight_states_trigger = {
				state = FROM
			}
		}

		allowed = {  
			original_tag = JAP 
		}

		state_target = yes

		target_array = ROOT.JAP_strategic_offensives_targets_array

	    target_trigger = {
	        FROM = {
	        	controller = {
	        		is_literally_china = yes
	        		has_war_with = ROOT
	        	}
	        	any_neighbor_state = {
	        		is_controlled_by_ROOT_or_ally = yes
	        	}
	        }
	    }
	    on_map_mode = map_only

		ai_will_do = {
			base = 10
		}

		visible = { 
			has_completed_focus = JAP_strategic_offensives
			any_enemy_country = {
				is_literally_china = yes
			}
		}
	
		available = {
			NOT = {
				has_country_flag = JAP_preparing_an_offensive_in_progress
			}
		}

		custom_cost_trigger = {
			command_power > 24.9
		}
		custom_cost_text = BRA_decision_cost_cangaceiro
		
		fire_only_once = yes

		days_remove = 7

		complete_effect = {
			hidden_effect = {
				add_command_power = -25
				set_country_flag = { flag = JAP_preparing_an_offensive_in_progress value = 1 days = 8 }
			}
		}

		cancel_trigger = {
			FROM = {
				OR = {
					is_controlled_by = ROOT
					controller = {
						NOT = {
							is_literally_china = yes
							has_war_with = ROOT
						}
					}
					NOT = {
						any_neighbor_state = {
							is_controlled_by_ROOT_or_ally = yes
						}
					}
				}
			}
		}

        cancel_effect = {
        	add_command_power = 5
        	hidden_effect = {
        		clr_country_flag = JAP_preparing_an_offensive_in_progress
        	}
        }

		modifier = {
		}

		remove_effect = {

			FROM = {
				add_dynamic_modifier = {
					modifier = JAP_chinese_offensive_military_offensive
					days = 70
					scope = JAP
				}
			}

			hidden_effect = {
				clr_country_flag = JAP_preparing_an_offensive_in_progress
			}

		}

	}


}



# Spiritual Mobilization
JAP_spiritual_mobilization_decisions = { 

	# Luxury is the Enemy!
	JAP_luxury_is_the_enemy_decision  = {

		priority = 10

		icon = GFX_decision_generic_consumer_goods

		ai_will_do = {
			base = 30
		}
	
		allowed = {  
			original_tag = JAP 
		}

		visible = { 
			OR = {
				has_completed_focus = JAP_sea_national_spiritual_mobliization_movement
				has_completed_focus = JAP_the_yamato_spirit
			}
			OR = {
				has_government = neutrality
				has_government = fascism
			}
		}
	
		available = {
			has_war = yes
		}

		#days_remove = 70

		#days_re_enable = 180

		cost = 75

		cancel_trigger = {
		}

        cancel_effect = {
        }

		modifier = {
		}

		complete_effect = { 

			IF = {
				limit = {
					has_completed_focus = JAP_sea_purge_the_kodoha_faction
				}
				JAP_add_or_modify_showa_statism = yes

				add_to_variable = { JAP_showa_statism_consumer_goods_factor = -0.05 tooltip = consumer_goods_factor_tt }
			}
			ELSE = {
				JAP_add_or_modify_imperial_way = yes

				add_to_variable = { JAP_the_imperial_way_consumer_goods_factor = -0.05 tooltip = consumer_goods_factor_tt }
			}

		}

		fire_only_once = yes

		remove_effect = {

		}

	}

	# Form a Labor Patriot Corps
	JAP_form_a_labor_patriot_corps_decision  = {

		priority = 9

		icon = GFX_decision_generic_merge_plant_materiel

		ai_will_do = {
			base = 20
		}
	
		allowed = {  
			original_tag = JAP 
		}

		visible = { 
			OR = {
				has_completed_focus = JAP_sea_national_spiritual_mobliization_movement
				has_completed_focus = JAP_the_yamato_spirit
			}
			OR = {
				has_government = neutrality
				has_government = fascism
			}
		}
	
		available = {
			has_war = yes
		}

		#days_remove = 70

		#days_re_enable = 180

		cost = 100

		cancel_trigger = {
		}

        cancel_effect = {
        }

		modifier = {
		}

		complete_effect = { 

			JAP_add_or_modify_early_industrialization = yes

			add_to_variable = { JAP_industry_production_speed_buildings_factor = 0.05 tooltip = production_speed_buildings_factor_tt }

		}

		fire_only_once = yes

		remove_effect = {

		}

	}

	# Produce Bullet Stamps
	JAP_produce_bullet_stamps_decision  = {

		priority = 8

		icon = GFX_decision_generic_industry

		ai_will_do = {
			base = 20
		}
	
		allowed = {  
			original_tag = JAP 
		}

		visible = { 
			OR = {
				has_completed_focus = JAP_sea_national_spiritual_mobliization_movement
				has_completed_focus = JAP_the_yamato_spirit
			}
			OR = {
				has_government = neutrality
				has_government = fascism
			}
		}
	
		available = {
			has_war = yes
		}

		#days_remove = 70

		#days_re_enable = 180

		cost = 75

		cancel_trigger = {
		}

        cancel_effect = {
        }

		modifier = {
		}

		complete_effect = { 

			random_core_state = {
				limit = {
					is_owned_and_controlled_by = ROOT
					free_building_slots = {
						building = arms_factory
						size > 1
						include_locked = yes
					}	
				}
				add_extra_state_shared_building_slots = 2
				add_building_construction = {
					type = arms_factory
					level = 2
					instant_build = yes
				}	
			}	

		}

		fire_only_once = yes

		remove_effect = {

		}

	}

	# Distribute Rations
	JAP_distribute_rations_decision  = {

		priority = 7

		icon = GFX_decision_SWI_support_humanitarian_efforts

		ai_will_do = {
			base = 25
		}
	
		allowed = {  
			original_tag = JAP 
		}

		visible = { 
			has_completed_focus = JAP_formalize_the_tonarigumi
			OR = {
				has_government = neutrality
				has_government = fascism
			}
		}
	
		available = {
			has_war = yes
		}

		#days_remove = 70

		#days_re_enable = 180

		cost = 50

		cancel_trigger = {
		}

        cancel_effect = {
        }

		modifier = {
		}

		complete_effect = { 

			add_timed_idea = {
				idea = JAP_distributing_rations
				days = 180
			}	

		}

		fire_only_once = yes

		remove_effect = {

		}

	}

	# Develop Sufu Materials
	JAP_develop_sufu_materials_decision  = {

		priority = 6

		icon = GFX_decision_generic_confiscation

		ai_will_do = {
			base = 5
		}
	
		allowed = {  
			original_tag = JAP 
		}

		visible = { 
			has_completed_focus = JAP_the_metal_collection_order
			OR = {
				has_government = neutrality
				has_government = fascism
			}
		}
	
		available = {
			has_war = yes
		}

		#days_remove = 70

		#days_re_enable = 180

		cost = 50

		cancel_trigger = {
		}

        cancel_effect = {
        }

		modifier = {
		}

		complete_effect = { 

			add_timed_idea = {
				idea = JAP_sufu_materials
				days = 360
			}	

		}

		fire_only_once = yes

		remove_effect = {

		}

	}

	# Collect Civilian Donations
	JAP_collect_civilian_donations_decision  = {

		priority = 5

		icon = GFX_decision_hol_attract_foreign_investors

		ai_will_do = {
			base = 30
		}
	
		allowed = {  
			original_tag = JAP 
		}

		visible = { 
			has_completed_focus = JAP_form_the_dai_nippon_fujinkai
			OR = {
				has_government = neutrality
				has_government = fascism
			}
		}
	
		available = {
			has_war = yes
		}

		#days_remove = 70

		#days_re_enable = 180

		cost = 75

		cancel_trigger = {
		}

        cancel_effect = {
        }

		modifier = {
		}

		complete_effect = { 

			add_stability = -0.03

			custom_effect_tooltip = generic_skip_one_line_tt

			add_offsite_building = {
				type = industrial_complex
				level = 2
			}	

		}

		fire_only_once = yes

		remove_effect = {

		}

	}

	# Raise Military Morale
	JAP_raise_military_moreale_decision  = {

		priority = 4

		icon = GFX_decision_generic_political_rally

		ai_will_do = {
			base = 30
		}
	
		allowed = {  
			original_tag = JAP 
		}

		visible = { 
			has_completed_focus = JAP_form_the_dai_nippon_fujinkai
			OR = {
				has_government = neutrality
				has_government = fascism
			}
		}
	
		available = {
			has_war = yes
		}

		#days_remove = 70

		#days_re_enable = 180

		cost = 75

		cancel_trigger = {
		}

        cancel_effect = {
        }

		modifier = {
		}

		complete_effect = { 

			add_war_support = 0.05

			custom_effect_tooltip = generic_skip_one_line_tt

			JAP_add_or_modify_imperial_army = yes

			add_to_variable = { JAP_army_army_morale_factor = 0.05 tooltip = army_morale_factor_tt }	

		}

		fire_only_once = yes

		remove_effect = {

		}

	}

	# Women in MIlitary Production
	JAP_women_in_military_production_decision  = {

		priority = 3

		icon = GFX_decision_generic_merge_plant_tank

		ai_will_do = {
			base = 20
		}
	
		allowed = {  
			original_tag = JAP 
		}

		visible = { 
			has_completed_focus = JAP_form_the_dai_nippon_fujinkai
			OR = {
				has_government = neutrality
				has_government = fascism
			}
		}
	
		available = {
			has_war = yes
		}

		#days_remove = 70

		#days_re_enable = 180

		cost = 50

		cancel_trigger = {
		}

        cancel_effect = {
        }

		modifier = {
		}

		complete_effect = { 

			JAP_add_or_modify_showa_statism = yes

			add_to_variable = { JAP_showa_statism_industrial_capacity_dockyard = 0.03 tooltip = industrial_capacity_dockyard_tt }
			add_to_variable = { JAP_showa_statism_industrial_capacity_factory = 0.03 tooltip = industrial_capacity_factory_tt }

		}

		fire_only_once = yes

		remove_effect = {

		}

	}


}










#### ##     ## ########  ######## ########  ####    ###    ##          #### ##    ## ######## ##       ##     ## ######## ##    ##  ######  ######## 
 ##  ###   ### ##     ## ##       ##     ##  ##    ## ##   ##           ##  ###   ## ##       ##       ##     ## ##       ###   ## ##    ## ##       
 ##  #### #### ##     ## ##       ##     ##  ##   ##   ##  ##           ##  ####  ## ##       ##       ##     ## ##       ####  ## ##       ##       
 ##  ## ### ## ########  ######   ########   ##  ##     ## ##           ##  ## ## ## ######   ##       ##     ## ######   ## ## ## ##       ######   
 ##  ##     ## ##        ##       ##   ##    ##  ######### ##           ##  ##  #### ##       ##       ##     ## ##       ##  #### ##       ##       
 ##  ##     ## ##        ##       ##    ##   ##  ##     ## ##           ##  ##   ### ##       ##       ##     ## ##       ##   ### ##    ## ##       
#### ##     ## ##        ######## ##     ## #### ##     ## ########    #### ##    ## ##       ########  #######  ######## ##    ##  ######  ########

JAP_imperial_influence_decision_cat = {

	### DECISIONS ###

	# Incite Increased Tensions in the Diet
	JAP_incite_increased_tensions_in_the_diet_decision  = {

		priority = 950

		icon = GFX_decision_generic_political_discourse

		ai_will_do = {
			base = 20
			modifier = {
				factor = 0
				is_historical_focus_on = yes 
			}
		}
	
		allowed = {  
			original_tag = JAP 
		}

		visible = { 
			has_completed_focus = JAP_promulgate_the_military_ministers_system
			OR = {
				has_government = neutrality
				has_government = fascism
			}
			NOT = {
				has_completed_focus = JAP_the_harakiri_debate
				has_completed_focus = JAP_reprimand_hamada_kunimatsu
			}
		}
	
		available = {
			has_active_mission = JAP_conflict_between_faction_reaching_boiling_point_mission
		}

		#days_remove = 70

		#days_re_enable = 180

		cost = 50

		cancel_trigger = {
		}

        cancel_effect = {
        }

		modifier = {
		}

		complete_effect = { 

			# Allows you to spend some pp to speed up the mission and the focus branch progression 
			add_days_mission_timeout = {
			    mission = JAP_conflict_between_faction_reaching_boiling_point_mission
			    days = -70 
			}

		}

		fire_only_once = yes

		remove_effect = {

		}

	}

	### MISSIONS ###

	# Conflict Between the Civilian Government and the Military Reaching a Breaking Point
	JAP_conflict_between_faction_reaching_boiling_point_mission = {

		priority = 1000

		icon = GFX_decision_generic_political_address #GFX_decision_generic_political_discourse

		available = {
			hidden_trigger = { always = no }
		}

		days_mission_timeout = 265  

		fire_only_once = yes

		activation = {
			always = no
		}

		visible = {
			original_tag = JAP
			has_civil_war = no
			has_government = neutrality
			NOT = {
				has_completed_focus = JAP_the_harakiri_debate
			}
		}

		cancel_if_not_visible = yes

		is_good = no

		timeout_effect = {

			country_event = {
				id = SEA_japan_popup_events.3
			}

		}

	}


	#ARMY DEMANDS
	JAP_army_faction_demands_military_factories = {

		priority = 1

		icon = GFX_decision_JAP_army_faction

		allowed = { always = no }

		visible = {
		}

		available = {
			hidden_trigger = { always = no }
		}

		days_mission_timeout = 180

		is_good = no

		#fire_only_once = yes

		#cancel_if_not_visible = yes
		cancel_trigger = {
			custom_trigger_tooltip = {
				tooltip = JAP_army_faction_demands_military_factories_tt
				num_of_military_factories > JAP_desired_military_factories 
			}
		}

		cancel_effect = {

			army_experience = 10
			add_timed_idea = {
				idea = JAP_temporary_factory_output_bonus_idea
				days = 90
			}	

			custom_effect_tooltip = generic_skip_one_line_tt

			JAP_faction_demand_finalize_mission_effect = yes
			JAP_faction_demand_add_to_successful_missions = yes
			JAP_small_army_faction_gain = yes
			
		}

		timeout_effect = { #Fails
			set_variable = { JAP_army_faction_demand_failure = 1 } #This is to keep track of what effects failure will give, since we're using the same event for all army failures
			country_event = {
				id = SEA_imperial_influence_events.100
				hours = 1
			}
			effect_tooltip = {
				JAP_small_army_faction_loss = yes
			}
		}
	}

	JAP_army_faction_demands_political_appointment = {

		priority = 1

		icon = GFX_decision_JAP_army_faction

		allowed = { always = no }

		visible = {
		}

		available = {
			hidden_trigger = { always = no }
		}

		days_mission_timeout = 90

		is_good = no

		#fire_only_once = yes

		#cancel_if_not_visible = yes
		cancel_trigger = {
			amount_taken_ideas = {
				amount > 0
				slots = { army_chief }
			}
		}

		cancel_effect = {

			add_command_power = 10
			army_experience = 10

			add_mastery_bonus  = {
				bonus = 0.15
				days = 180
				name = JAP_supreme_council_for_direction_of_war
				track = operations
			}

			custom_effect_tooltip = generic_skip_one_line_tt

			JAP_faction_demand_finalize_mission_effect = yes
			JAP_faction_demand_add_to_successful_missions = yes
			JAP_small_army_faction_gain = yes
			
		}

		timeout_effect = { #Fails
			#set_variable = { JAP_army_faction_demand_failure = 1 } #This is to keep track of what effects failure will give, since we're using the same event for all army failures
			country_event = {
				id = SEA_imperial_influence_events.100
				hours = 1
			}
			effect_tooltip = {
				JAP_small_army_faction_loss = yes
				
			}
		}
	}

	JAP_army_faction_demands_conscription_law_change = {

		priority = 1

		icon = GFX_decision_JAP_army_faction

		allowed = { always = no }

		visible = {
		}

		available = {
			hidden_trigger = { always = no }
		}

		days_mission_timeout = 90

		is_good = no

		#fire_only_once = yes

		#cancel_if_not_visible = yes
		cancel_trigger = {
			IF = {
				limit = {
					has_country_flag = JAP_in_on_disarmed_nation_flag 
				}
				OR = {
					has_idea = volunteer_only
					has_idea = limited_conscription
					has_idea = extensive_conscription
					has_idea = service_by_requirement
					has_idea = all_adults_serve
					has_idea = scraping_the_barrel
				}
			}
			ELSE_IF = {
				limit = {
					has_country_flag = JAP_in_on_volunteer_only_flag
				}
				OR = {
					has_idea = limited_conscription
					has_idea = extensive_conscription
					has_idea = service_by_requirement
					has_idea = all_adults_serve
					has_idea = scraping_the_barrel
				}
			}
			ELSE_IF = {
				limit = {
					has_country_flag = JAP_in_on_limited_conscription_flag
				}
				OR = {
					has_idea = extensive_conscription
					has_idea = service_by_requirement
					has_idea = all_adults_serve
					has_idea = scraping_the_barrel
				}
			}
			ELSE_IF = {
				limit = {
					has_country_flag = JAP_in_on_extensive_conscription_flag
				}
				OR = {
					has_idea = service_by_requirement
					has_idea = all_adults_serve
					has_idea = scraping_the_barrel
				}
			}
			ELSE_IF = {
				limit = {
					has_country_flag = JAP_in_on_service_by_requirement_flag
				}
				OR = {
					has_idea = all_adults_serve
					has_idea = scraping_the_barrel
				}
			}
			ELSE_IF = {
				limit = {
					has_country_flag = JAP_in_on_all_adults_serve_flag
				}
				has_idea = scraping_the_barrel
			}
		}

		cancel_effect = {

			add_command_power = 10
			army_experience = 10

			add_timed_idea = {
				idea = JAP_temporary_manpower_growth_bonus_idea
				days = 90
			}	

			custom_effect_tooltip = generic_skip_one_line_tt

			JAP_faction_demand_finalize_mission_effect = yes
			JAP_faction_demand_add_to_successful_missions = yes
			JAP_small_army_faction_gain = yes
			
			clr_country_flag = JAP_military_demands_conscription_law_change

			hidden_effect = {
				IF = {
					limit = {
						has_country_flag = JAP_in_on_disarmed_nation_flag
					}
					clr_country_flag = JAP_in_on_disarmed_nation_flag
				}
				ELSE_IF = {
					limit = {
						has_country_flag = JAP_in_on_volunteer_only_flag
					}
					clr_country_flag = JAP_in_on_volunteer_only_flag
				}
				ELSE_IF = {
					limit = {
						has_country_flag = JAP_in_on_limited_conscription_flag
					}
					clr_country_flag = JAP_in_on_limited_conscription_flag
				}
				ELSE_IF = {
					limit = {
						has_country_flag = JAP_in_on_extensive_conscription_flag
					}
					clr_country_flag = JAP_in_on_extensive_conscription_flag
				}
				ELSE_IF = {
					limit = {
						has_country_flag = JAP_in_on_service_by_requirement_flag
					}
					clr_country_flag = JAP_in_on_service_by_requirement_flag
				}
				ELSE_IF = {
					limit = {
						has_country_flag = JAP_in_on_all_adults_serve_flag
					}
					clr_country_flag = JAP_in_on_all_adults_serve_flag
				}
			}

		}

		timeout_effect = { #Fails
			clr_country_flag = JAP_military_demands_conscription_law_change
			#set_variable = { JAP_army_faction_demand_failure = 1 } #This is to keep track of what effects failure will give, since we're using the same event for all army failures
			country_event = {
				id = SEA_imperial_influence_events.100
				hours = 1
			}
			effect_tooltip = {
				JAP_small_army_faction_loss = yes
			}

			hidden_effect = {
				IF = {
					limit = {
						has_country_flag = JAP_in_on_disarmed_nation_flag
					}
					clr_country_flag = JAP_in_on_disarmed_nation_flag
				}
				ELSE_IF = {
					limit = {
						has_country_flag = JAP_in_on_volunteer_only_flag
					}
					clr_country_flag = JAP_in_on_volunteer_only_flag
				}
				ELSE_IF = {
					limit = {
						has_country_flag = JAP_in_on_limited_conscription_flag
					}
					clr_country_flag = JAP_in_on_limited_conscription_flag
				}
				ELSE_IF = {
					limit = {
						has_country_flag = JAP_in_on_extensive_conscription_flag
					}
					clr_country_flag = JAP_in_on_extensive_conscription_flag
				}
				ELSE_IF = {
					limit = {
						has_country_flag = JAP_in_on_service_by_requirement_flag
					}
					clr_country_flag = JAP_in_on_service_by_requirement_flag
				}
				ELSE_IF = {
					limit = {
						has_country_flag = JAP_in_on_all_adults_serve_flag
					}
					clr_country_flag = JAP_in_on_all_adults_serve_flag
				}
			}

		}
	}

	JAP_army_faction_demands_larger_army = {

		priority = 1

		icon = GFX_decision_JAP_army_faction

		allowed = { always = no }

		visible = {
		}

		available = {
			hidden_trigger = { always = no }
		}

		days_mission_timeout = 365

		is_good = no

		#fire_only_once = yes

		#cancel_if_not_visible = yes
		cancel_trigger = {
			IF = {
				limit = {
					has_country_flag = JAP_has_less_than_600k_flag 
				}
				has_army_manpower = {
					size > 600000
				}	
			}
			ELSE_IF = {
				limit = {
					has_country_flag = JAP_has_less_than_750k_flag 
				}
				has_army_manpower = {
					size > 750000
				}	
			}
			ELSE_IF = {
				limit = {
					has_country_flag = JAP_has_less_than_1mil_flag 
				}
				has_army_manpower = {
					size > 1000000
				}	
			}
			ELSE_IF = {
				limit = {
					has_country_flag = JAP_has_less_than_1_and_a_half_mil_flag 
				}
				has_army_manpower = {
					size > 1500000
				}	
			}
			ELSE_IF = {
				limit = {
					has_country_flag = JAP_has_less_than_2mil_flag 
				}
				has_army_manpower = {
					size > 2000000
				}	
			}
		}

		cancel_effect = {

			army_experience = 15

			add_mastery_bonus  = {
				bonus = 0.15
				days = 180
				name = JAP_enact_the_national_conscription_law
				track = infantry
			}

			custom_effect_tooltip = generic_skip_one_line_tt

			JAP_faction_demand_finalize_mission_effect = yes
			JAP_faction_demand_add_to_successful_missions = yes
			JAP_small_army_faction_gain = yes
			
			hidden_effect = {
				IF = {
					limit = {	
						has_country_flag = JAP_has_less_than_600k_flag
					}
					clr_country_flag = JAP_has_less_than_600k_flag
				}
				ELSE_IF = {
					limit = {	
						has_country_flag = JAP_has_less_than_750k_flag
					}
					clr_country_flag = JAP_has_less_than_750k_flag
				}
				ELSE_IF = {
					limit = {	
						has_country_flag = JAP_has_less_than_1mil_flag
					}
					clr_country_flag = JAP_has_less_than_1mil_flag
				}
				ELSE_IF = {
					limit = {	
						has_country_flag = JAP_has_less_than_1_and_a_half_mil_flag
					}
					clr_country_flag = JAP_has_less_than_1_and_a_half_mil_flag
				}
				ELSE_IF = {
					limit = {	
						has_country_flag = JAP_has_less_than_2mil_flag
					}
					clr_country_flag = JAP_has_less_than_2mil_flag
				}
			}
		}

		timeout_effect = { #Fails
			#set_variable = { JAP_army_faction_demand_failure = 1 } #This is to keep track of what effects failure will give, since we're using the same event for all army failures
			country_event = {
				id = SEA_imperial_influence_events.100
				hours = 1
			}
			effect_tooltip = {
				JAP_small_army_faction_loss = yes
			}
			hidden_effect = {
				IF = {
					limit = {	
						has_country_flag = JAP_has_less_than_750k_flag
					}
					clr_country_flag = JAP_has_less_than_750k_flag
				}
				ELSE_IF = {
					limit = {	
						has_country_flag = JAP_has_less_than_1mil_flag
					}
					clr_country_flag = JAP_has_less_than_1mil_flag
				}
				ELSE_IF = {
					limit = {	
						has_country_flag = JAP_has_less_than_1_and_a_half_mil_flag
					}
					clr_country_flag = JAP_has_less_than_1_and_a_half_mil_flag
				}
				ELSE_IF = {
					limit = {	
						has_country_flag = JAP_has_less_than_2mil_flag
					}
					clr_country_flag = JAP_has_less_than_2mil_flag
				}
			}
		}
	}

	JAP_army_faction_demands_more_trucks = {

		priority = 1

		icon = GFX_decision_JAP_army_faction

		allowed = { always = no }

		visible = {
		}

		available = {
			hidden_trigger = { always = no }
		}

		days_mission_timeout = 270

		is_good = no

		#fire_only_once = yes

		#cancel_if_not_visible = yes
		cancel_trigger = {
			has_equipment = {
				motorized_equipment > 199
				show_current = yes
			}
		}

		cancel_effect = {

			army_experience = 15

			add_timed_idea = {
				idea = JAP_temporary_better_supply_lines_bonus_idea
				days = 90
			}	

			custom_effect_tooltip = generic_skip_one_line_tt

			JAP_faction_demand_finalize_mission_effect = yes
			JAP_faction_demand_add_to_successful_missions = yes
			JAP_small_army_faction_gain = yes
			
		}

		timeout_effect = { #Fails
			#set_variable = { JAP_army_faction_demand_failure = 1 } #This is to keep track of what effects failure will give, since we're using the same event for all army failures
			country_event = {
				id = SEA_imperial_influence_events.100
				hours = 1
			}
			effect_tooltip = {
				JAP_small_army_faction_loss = yes
				
			}
		}
	}

	JAP_army_faction_demands_more_tanks = {

		priority = 1

		icon = GFX_decision_JAP_army_faction

		allowed = { always = no }

		visible = {
		}

		available = {
			hidden_trigger = { always = no }
		}

		days_mission_timeout = 365

		is_good = no

		#fire_only_once = yes

		#cancel_if_not_visible = yes
		cancel_trigger = {
			OR = {
				AND = {
					NOT = { has_tech = basic_medium_tank_chassis }
					has_equipment = {
						light_tank_chassis > 999
					}
				}
				AND = {
					has_tech = basic_medium_tank_chassis
					has_equipment = {
						medium_tank_chassis > 299
					}
				}
			}
		}

		cancel_effect = {

			army_experience = 15

			add_mastery_bonus  = {
				bonus = 0.15
				days = 180
				name = JAP_rethink_armor_doctrine
				track = armor
			}

			custom_effect_tooltip = generic_skip_one_line_tt

			JAP_faction_demand_finalize_mission_effect = yes
			JAP_faction_demand_add_to_successful_missions = yes
			JAP_small_army_faction_gain = yes
			
		}

		timeout_effect = { #Fails
			#set_variable = { JAP_army_faction_demand_failure = 1 } #This is to keep track of what effects failure will give, since we're using the same event for all army failures
			country_event = {
				id = SEA_imperial_influence_events.100
				hours = 1
			}
			effect_tooltip = {
				JAP_small_army_faction_loss = yes
				
			}
		}
	}

	JAP_army_faction_demands_more_artillery = {

		priority = 1

		icon = GFX_decision_JAP_army_faction

		allowed = { always = no }

		visible = {
		}

		available = {
			hidden_trigger = { always = no }
		}

		days_mission_timeout = 365

		is_good = no

		#fire_only_once = yes

		#cancel_if_not_visible = yes
		cancel_trigger = {
			has_equipment = {
				artillery_equipment > 299
			}
		}

		cancel_effect = {

			army_experience = 15

			add_mastery_bonus  = {
				bonus = 0.15
				days = 180
				name = JAP_adopt_new_assault_doctrine
				track = combat_support
			}

			custom_effect_tooltip = generic_skip_one_line_tt

			JAP_faction_demand_finalize_mission_effect = yes
			JAP_faction_demand_add_to_successful_missions = yes
			JAP_small_army_faction_gain = yes
			
		}

		timeout_effect = { #Fails
			#set_variable = { JAP_army_faction_demand_failure = 1 } #This is to keep track of what effects failure will give, since we're using the same event for all army failures
			country_event = {
				id = SEA_imperial_influence_events.100
				hours = 1
			}
			effect_tooltip = {
				JAP_small_army_faction_loss = yes
				
			}
		}
	}

	#NAVY DEMANDS
	JAP_naval_faction_demands_dockyards = {

		priority = 1

		icon = GFX_decision_JAP_naval_faction

		allowed = { always = no }

		visible = {
		}

		available = {
			hidden_trigger = { always = no }
		}

		days_mission_timeout = 180

		is_good = no

		#fire_only_once = yes

		#cancel_if_not_visible = yes
		cancel_trigger = {
			custom_trigger_tooltip = {
				tooltip = JAP_naval_faction_demands_dockyards_tt
				num_of_naval_factories > JAP_desired_naval_factories 
			}
		}

		cancel_effect = {

			navy_experience = 15

			add_timed_idea = {
				idea = JAP_temporary_dockyard_output_bonus_idea
				days = 90
			}	

			custom_effect_tooltip = generic_skip_one_line_tt

			JAP_faction_demand_finalize_mission_effect = yes
			JAP_faction_demand_add_to_successful_missions = yes
			JAP_small_naval_faction_gain = yes
			
		}

		timeout_effect = { #Fails
			set_variable = { JAP_naval_faction_demand_failure = 1 } #This is to keep track of what effects failure will give, since we're using the same event for all navy failures
			country_event = {
				id = SEA_imperial_influence_events.200
				hours = 1
			}
			effect_tooltip = {
				JAP_small_naval_faction_loss = yes
				
			}
		}
	}

	JAP_naval_faction_demands_political_appointment = {

		priority = 1

		icon = GFX_decision_JAP_naval_faction

		allowed = { always = no }

		visible = {
		}

		available = {
			hidden_trigger = { always = no }
		}

		days_mission_timeout = 90

		is_good = no

		#fire_only_once = yes

		#cancel_if_not_visible = yes
		cancel_trigger = {
			amount_taken_ideas = {
				amount > 0
				slots = { navy_chief }
			}
		}

		cancel_effect = {

			add_command_power = 10
			navy_experience = 15

			add_doctrine_cost_reduction = {
				name = JAP_expand_navy_technical_department
				cost_reduction = 0.75
				uses = 1
				category = naval
			}	

			custom_effect_tooltip = generic_skip_one_line_tt

			JAP_faction_demand_finalize_mission_effect = yes
			JAP_faction_demand_add_to_successful_missions = yes
			JAP_small_naval_faction_gain = yes
			
		}

		timeout_effect = { #Fails
			#set_variable = { JAP_naval_faction_demand_failure = 1 } #This is to keep track of what effects failure will give, since we're using the same event for all naval failures
			country_event = {
				id = SEA_imperial_influence_events.200
				hours = 1
			}
			effect_tooltip = {
				JAP_small_naval_faction_loss = yes
				
			}
		}
	}

	JAP_naval_faction_demands_conscription_law_change = {

		priority = 1

		icon = GFX_decision_JAP_naval_faction

		allowed = { always = no }

		visible = {
		}

		available = {
			hidden_trigger = { always = no }
		}

		days_mission_timeout = 90

		is_good = no

		#fire_only_once = yes

		#cancel_if_not_visible = yes
		cancel_trigger = {
			IF = {
				limit = {
					has_country_flag = JAP_in_on_disarmed_nation_flag 
				}
				OR = {
					has_idea = volunteer_only
					has_idea = limited_conscription
					has_idea = extensive_conscription
					has_idea = service_by_requirement
					has_idea = all_adults_serve
					has_idea = scraping_the_barrel
				}
			}
			ELSE_IF = {
				limit = {
					has_country_flag = JAP_in_on_volunteer_only_flag
				}
				OR = {
					has_idea = limited_conscription
					has_idea = extensive_conscription
					has_idea = service_by_requirement
					has_idea = all_adults_serve
					has_idea = scraping_the_barrel
				}
			}
			ELSE_IF = {
				limit = {
					has_country_flag = JAP_in_on_limited_conscription_flag
				}
				OR = {
					has_idea = extensive_conscription
					has_idea = service_by_requirement
					has_idea = all_adults_serve
					has_idea = scraping_the_barrel
				}
			}
			ELSE_IF = {
				limit = {
					has_country_flag = JAP_in_on_extensive_conscription_flag
				}
				OR = {
					has_idea = service_by_requirement
					has_idea = all_adults_serve
					has_idea = scraping_the_barrel
				}
			}
			ELSE_IF = {
				limit = {
					has_country_flag = JAP_in_on_service_by_requirement_flag
				}
				OR = {
					has_idea = all_adults_serve
					has_idea = scraping_the_barrel
				}
			}
			ELSE_IF = {
				limit = {
					has_country_flag = JAP_in_on_all_adults_serve_flag
				}
				has_idea = scraping_the_barrel
			}
		}

		cancel_effect = {

			add_command_power = 10
			navy_experience = 10

			add_timed_idea = {
				idea = JAP_temporary_manpower_growth_bonus_idea
				days = 90
			}	

			JAP_faction_demand_finalize_mission_effect = yes
			JAP_faction_demand_add_to_successful_missions = yes
			clr_country_flag = JAP_military_demands_conscription_law_change
			JAP_small_naval_faction_gain = yes
			
			hidden_effect = {
				IF = {
					limit = {
						has_country_flag = JAP_in_on_disarmed_nation_flag
					}
					clr_country_flag = JAP_in_on_disarmed_nation_flag
				}
				ELSE_IF = {
					limit = {
						has_country_flag = JAP_in_on_volunteer_only_flag
					}
					clr_country_flag = JAP_in_on_volunteer_only_flag
				}
				ELSE_IF = {
					limit = {
						has_country_flag = JAP_in_on_limited_conscription_flag
					}
					clr_country_flag = JAP_in_on_limited_conscription_flag
				}
				ELSE_IF = {
					limit = {
						has_country_flag = JAP_in_on_extensive_conscription_flag
					}
					clr_country_flag = JAP_in_on_extensive_conscription_flag
				}
				ELSE_IF = {
					limit = {
						has_country_flag = JAP_in_on_service_by_requirement_flag
					}
					clr_country_flag = JAP_in_on_service_by_requirement_flag
				}
				ELSE_IF = {
					limit = {
						has_country_flag = JAP_in_on_all_adults_serve_flag
					}
					clr_country_flag = JAP_in_on_all_adults_serve_flag
				}
			}
		}

		timeout_effect = { #Fails
			clr_country_flag = JAP_military_demands_conscription_law_change
			#set_variable = { JAP_naval_faction_demand_failure = 1 } #This is to keep track of what effects failure will give, since we're using the same event for all naval failures
			country_event = {
				id = SEA_imperial_influence_events.200
				hours = 1
			}
			effect_tooltip = {
				JAP_small_naval_faction_loss = yes
				
			}
			hidden_effect = {
				IF = {
					limit = {
						has_country_flag = JAP_in_on_disarmed_nation_flag
					}
					clr_country_flag = JAP_in_on_disarmed_nation_flag
				}
				ELSE_IF = {
					limit = {
						has_country_flag = JAP_in_on_volunteer_only_flag
					}
					clr_country_flag = JAP_in_on_volunteer_only_flag
				}
				ELSE_IF = {
					limit = {
						has_country_flag = JAP_in_on_limited_conscription_flag
					}
					clr_country_flag = JAP_in_on_limited_conscription_flag
				}
				ELSE_IF = {
					limit = {
						has_country_flag = JAP_in_on_extensive_conscription_flag
					}
					clr_country_flag = JAP_in_on_extensive_conscription_flag
				}
				ELSE_IF = {
					limit = {
						has_country_flag = JAP_in_on_service_by_requirement_flag
					}
					clr_country_flag = JAP_in_on_service_by_requirement_flag
				}
				ELSE_IF = {
					limit = {
						has_country_flag = JAP_in_on_all_adults_serve_flag
					}
					clr_country_flag = JAP_in_on_all_adults_serve_flag
				}
			}
		}
	}

	JAP_naval_faction_demands_more_carriers = {

		priority = 1

		icon = GFX_decision_JAP_naval_faction

		allowed = { always = no }

		visible = {
		}

		available = {
			hidden_trigger = { always = no }
		}

		days_mission_timeout = 365

		is_good = no

		#fire_only_once = yes

		#cancel_if_not_visible = yes
		cancel_trigger = {
			has_navy_size = {
				unit = carrier
				size > 10
			}
		}

		cancel_effect = {

			navy_experience = 15

			add_mastery_bonus  = {
				bonus = 0.15
				days = 180
				name = JAP_focus_on_aircraft_carriers
				track = carriers
			}

			custom_effect_tooltip = generic_skip_one_line_tt

			JAP_faction_demand_finalize_mission_effect = yes
			JAP_faction_demand_add_to_successful_missions = yes
			JAP_small_naval_faction_gain = yes
			
		}

		timeout_effect = { #Fails
			#set_variable = { JAP_naval_faction_demand_failure = 1 } #This is to keep track of what effects failure will give, since we're using the same event for all naval failures
			country_event = {
				id = SEA_imperial_influence_events.200
				hours = 1
			}
			effect_tooltip = {
				JAP_small_naval_faction_loss = yes
				
			}
		}
	}

	JAP_naval_faction_demands_more_carriers_and_battleships = {

		priority = 1

		icon = GFX_decision_JAP_naval_faction

		allowed = { always = no }

		visible = {
		}

		available = {
			hidden_trigger = { always = no }
		}

		days_mission_timeout = 365

		is_good = no

		#fire_only_once = yes

		#cancel_if_not_visible = yes
		cancel_trigger = {
			AND = {
				has_navy_size = {
					unit = carrier 
					size > 8
				}
				has_navy_size = {
					archetype = ship_hull_heavy
					size > 12
				}
			}
		}

		cancel_effect = {

			navy_experience = 15

			add_mastery_bonus  = {
				bonus = 0.1
				days = 180
				name = JAP_balanced_naval_approach
				track = carriers
			}
			add_mastery_bonus  = {
				bonus = 0.1
				days = 180
				name = JAP_balanced_naval_approach
				track = capital_ships
			}

			custom_effect_tooltip = generic_skip_one_line_tt

			JAP_faction_demand_finalize_mission_effect = yes
			JAP_faction_demand_add_to_successful_missions = yes
			JAP_small_naval_faction_gain = yes
			
		}

		timeout_effect = { #Fails
			#set_variable = { JAP_naval_faction_demand_failure = 1 } #This is to keep track of what effects failure will give, since we're using the same event for all naval failures
			country_event = {
				id = SEA_imperial_influence_events.200
				hours = 1
			}
			effect_tooltip = {
				JAP_small_naval_faction_loss = yes
				
			}
		}
	}

	JAP_naval_faction_demands_more_battleships = {

		priority = 1

		icon = GFX_decision_JAP_naval_faction

		allowed = { always = no }

		visible = {
		}

		available = {
			hidden_trigger = { always = no }
		}

		days_mission_timeout = 365

		is_good = no

		#fire_only_once = yes

		#cancel_if_not_visible = yes
		cancel_trigger = {
			has_navy_size = {
				archetype = ship_hull_heavy
				size > 15
			}
		}

		cancel_effect = {

			navy_experience = 15

			add_mastery_bonus  = {
				bonus = 0.15
				days = 180
				name = JAP_sea_battleship_initiative
				track = capital_ships
			}

			custom_effect_tooltip = generic_skip_one_line_tt

			JAP_faction_demand_finalize_mission_effect = yes
			JAP_faction_demand_add_to_successful_missions = yes
			JAP_small_naval_faction_gain = yes
			
		}

		timeout_effect = { #Fails
			#set_variable = { JAP_naval_faction_demand_failure = 1 } #This is to keep track of what effects failure will give, since we're using the same event for all naval failures
			country_event = {
				id = SEA_imperial_influence_events.200
				hours = 1
			}
			effect_tooltip = {
				JAP_small_naval_faction_loss = yes
				
			}
		}
	}

	JAP_naval_faction_demands_strike_south_happen_mission = {

		priority = 10

		icon = GFX_decision_JAP_naval_faction

		allowed = { always = no }

		visible = {
		}

		available = {
			hidden_trigger = { always = no }
		}

		days_mission_timeout = 365

		is_good = no

		#fire_only_once = yes

		#cancel_if_not_visible = yes
		cancel_trigger = {
			has_completed_focus = JAP_strike_the_southern_road
			OR = {
				has_war_with = ENG
				has_war_with = USA
				has_war_with = PHI
				has_war_with = INS
				has_war_with = MAL
			}
		}

		cancel_effect = {
			add_mastery_bonus  = {
				bonus = 0.25
				days = 180
				name = JAP_strike_the_southern_road
				track = capital_ships
			}
			add_mastery_bonus  = {
				bonus = 0.25
				days = 180
				name = JAP_strike_the_southern_road
				track = carriers
			}
			custom_effect_tooltip = generic_skip_one_line_tt
			add_command_power = 25
			add_war_support = 0.05
			custom_effect_tooltip = generic_skip_one_line_tt
			JAP_big_naval_faction_gain = yes
		}

		timeout_effect = { #Fails
			
			country_event = {
				id = SEA_imperial_influence_events.501
				hours = 1
			}
			effect_tooltip = {
				navy_experience = -50
				add_command_power = -50
				add_political_power = -50
				add_war_support = -0.1

				custom_effect_tooltip = generic_skip_one_line_tt
				
				JAP_small_naval_faction_loss = yes
			}
		}
	}

	#ZAIBATSU DEMANDS
	JAP_zaibatsu_faction_demands_factories = {

		priority = 1

		icon = GFX_decision_JAP_zaibatsu_faction

		allowed = { always = no }

		visible = {
		}

		available = {
			hidden_trigger = { always = no }
		}

		days_mission_timeout = 180

		is_good = no

		#fire_only_once = yes

		#cancel_if_not_visible = yes
		cancel_trigger = {
			custom_trigger_tooltip = {
				tooltip = JAP_zaibatsu_faction_demands_dockyards_tt
				num_of_civilian_factories > JAP_desired_civilian_factories
			}
		}

		cancel_effect = {

			add_timed_idea = {
				idea = JAP_temporary_construction_bonus_idea
				days = 90
			}	

			custom_effect_tooltip = generic_skip_one_line_tt

			JAP_faction_demand_finalize_mission_effect = yes
			JAP_faction_demand_add_to_successful_missions = yes
			JAP_small_zaibatsu_faction_gain = yes
			
		}

		timeout_effect = { #Fails
			set_variable = { JAP_zaibatsu_faction_demand_failure = 1 } #This is to keep track of what effects failure will give, since we're using the same event for all Zaibatsu failures
			country_event = {
				id = SEA_imperial_influence_events.300
				hours = 1
			}
			effect_tooltip = {
				JAP_small_zaibatsu_faction_loss = yes
				
			}
		}
	}

	JAP_zaibatsu_faction_demands_political_appointment = {

		priority = 1

		icon = GFX_decision_JAP_zaibatsu_faction

		allowed = { always = no }

		visible = {
		}

		available = {
			hidden_trigger = { always = no }
		}

		days_mission_timeout = 90

		is_good = no

		#fire_only_once = yes

		#cancel_if_not_visible = yes
		cancel_trigger = {
			OR = {
				JAP_yosuke_matsuoka = {
					is_political_advisor = yes
				}
				JAP_koyata_iwasaki = {
					is_political_advisor = yes
				}
				JAP_chikuhei_nakajima = {
					is_political_advisor = yes
				}
				JAP_yoshisuke_aikawa = {
					is_political_advisor = yes
				}
				JAP_kenjiro_matsumoto = {
					is_political_advisor = yes
				}
			}
		}

		cancel_effect = {

			add_political_power = 25

			add_cic = 500 

			custom_effect_tooltip = generic_skip_one_line_tt

			JAP_faction_demand_finalize_mission_effect = yes
			JAP_faction_demand_add_to_successful_missions = yes
			JAP_small_zaibatsu_faction_gain = yes
			
		}

		timeout_effect = { #Fails
			#set_variable = { JAP_zaibatsu_faction_demand_failure = 1 } #This is to keep track of what effects failure will give, since we're using the same event for all Zaibatsu failures
			country_event = {
				id = SEA_imperial_influence_events.300
				hours = 1
			}
			effect_tooltip = {
				JAP_small_zaibatsu_faction_loss = yes
				
			}
		}
	}

	JAP_zaibatsu_faction_demands_economy_law_change = {

		priority = 1

		icon = GFX_decision_JAP_zaibatsu_faction

		allowed = { always = no }

		visible = {
		}

		available = {
			hidden_trigger = { always = no }
		}

		days_mission_timeout = 90

		is_good = no

		#fire_only_once = yes

		#cancel_if_not_visible = yes
		cancel_trigger = {
			IF = {
				limit = {
					has_country_flag = JAP_in_on_total_economic_mobilization_flag
				}
				OR = {
					has_idea = war_economy
					has_idea = partial_economic_mobilisation
					has_idea = low_economic_mobilisation
					has_idea = civilian_economy
				}
			}
			ELSE_IF = {
				limit = {
					has_country_flag = JAP_in_on_war_economy_flag
				}
				OR = {
					has_idea = partial_economic_mobilisation
					has_idea = low_economic_mobilisation
					has_idea = civilian_economy
				}
			}
			ELSE_IF = {
				limit = {
					has_country_flag = JAP_in_on_partial_economic_mobilisation_flag
				}
				OR = {
					has_idea = low_economic_mobilisation
					has_idea = civilian_economy
				}
			}
			ELSE_IF = {
				limit = {
					has_country_flag = JAP_in_on_low_economic_mobilisation_flag
				}
				has_idea = civilian_economy
			}
		}

		cancel_effect = {

			add_cic = 1000 

			custom_effect_tooltip = generic_skip_one_line_tt

			JAP_faction_demand_finalize_mission_effect = yes
			JAP_faction_demand_add_to_successful_missions = yes
			JAP_small_zaibatsu_faction_gain = yes
			

			hidden_effect = {
				IF = {
					limit = {
						has_country_flag = JAP_in_on_total_economic_mobilization_flag
					}
					clr_country_flag = JAP_in_on_total_economic_mobilization_flag
				}
				ELSE_IF = {
					limit = {
						has_country_flag = JAP_in_on_war_economy_flag
					}
					clr_country_flag = JAP_in_on_war_economy_flag
				}
				ELSE_IF = {
					limit = {
						has_country_flag = JAP_in_on_partial_economic_mobilisation_flag
					}
					clr_country_flag = JAP_in_on_partial_economic_mobilisation_flag
				}
				ELSE_IF = {
					limit = {
						has_country_flag = JAP_in_on_low_economic_mobilisation_flag
					}
					clr_country_flag = JAP_in_on_low_economic_mobilisation_flag
				}
			}

		}

		timeout_effect = { #Fails
			#set_variable = { JAP_zaibatsu_faction_demand_failure = 1 } #This is to keep track of what effects failure will give, since we're using the same event for all Zaibatsu failures
			country_event = {
				id = SEA_imperial_influence_events.300
				hours = 1
			}
			effect_tooltip = {
				JAP_small_zaibatsu_faction_loss = yes
			}

			hidden_effect = {
				IF = {
					limit = {
						has_country_flag = JAP_in_on_total_economic_mobilization_flag
					}
					clr_country_flag = JAP_in_on_total_economic_mobilization_flag
				}
				ELSE_IF = {
					limit = {
						has_country_flag = JAP_in_on_war_economy_flag
					}
					clr_country_flag = JAP_in_on_war_economy_flag
				}
				ELSE_IF = {
					limit = {
						has_country_flag = JAP_in_on_partial_economic_mobilisation_flag
					}
					clr_country_flag = JAP_in_on_partial_economic_mobilisation_flag
				}
				ELSE_IF = {
					limit = {
						has_country_flag = JAP_in_on_low_economic_mobilisation_flag
					}
					clr_country_flag = JAP_in_on_low_economic_mobilisation_flag
				}
			}

		}
	}

	JAP_zaibatsu_faction_demands_industrial_company_employment = {

		priority = 1

		icon = GFX_decision_JAP_zaibatsu_faction

		allowed = { always = no }

		visible = {
		}

		available = {
			hidden_trigger = { always = no }
		}

		days_mission_timeout = 90

		is_good = no

		#fire_only_once = yes

		#cancel_if_not_visible = yes
		cancel_trigger = {
			OR = {
				has_idea = sumitomo
				has_idea = mitsubishi_civilian
				has_idea = mitsui_bank
				has_idea = yasuda_zaibatsu
			}
		}

		cancel_effect = {

			add_tech_bonus = {
				name = JAP_zaibatsu_faction_demands_industrial_company_employment
				bonus = 0.25
				uses = 1
				category = cat_production
			}
			add_tech_bonus = {
				name = JAP_zaibatsu_faction_demands_industrial_company_employment
				bonus = 0.25
				uses = 1
				category = excavation_tech
			}
			add_tech_bonus = {
				name = JAP_zaibatsu_faction_demands_industrial_company_employment
				bonus = 0.25
				uses = 1
				category = construction_tech
			}

			custom_effect_tooltip = generic_skip_one_line_tt

			JAP_faction_demand_finalize_mission_effect = yes
			JAP_faction_demand_add_to_successful_missions = yes
			JAP_small_zaibatsu_faction_gain = yes
			
		}

		timeout_effect = { #Fails
			#set_variable = { JAP_zaibatsu_faction_demand_failure = 1 } #This is to keep track of what effects failure will give, since we're using the same event for all Zaibatsu failures
			country_event = {
				id = SEA_imperial_influence_events.300
				hours = 1
			}
			effect_tooltip = {
				JAP_small_zaibatsu_faction_loss = yes
				
			}
		}
	}

	#GOVERNMENT DEMANDS
	JAP_government_faction_demands_political_appointment = {

		priority = 1

		icon = GFX_decision_JAP_civic_faction

		allowed = { always = no }

		visible = {
		}

		available = {
			hidden_trigger = { always = no }
		}

		days_mission_timeout = 365

		is_good = no

		#fire_only_once = yes

		#cancel_if_not_visible = yes
		cancel_trigger = {
			amount_taken_ideas = {
				amount > 2
				slots = { political_advisor }
			}
		}

		cancel_effect = {

			add_political_power = 50

			add_popularity = {
				ideology = ROOT
				popularity = 0.05
			}	

			custom_effect_tooltip = generic_skip_one_line_tt

			JAP_faction_demand_finalize_mission_effect = yes
			JAP_faction_demand_add_to_successful_missions = yes
			JAP_small_government_faction_gain = yes
			
		}

		timeout_effect = { #Fails
			#set_variable = { JAP_government_faction_demand_failure = 1 } #This is to keep track of what effects failure will give, since we're using the same event for all Government failures
			country_event = {
				id = SEA_imperial_influence_events.400
				hours = 1
			}
			effect_tooltip = {
				JAP_small_government_faction_loss = yes
				
			}
		}
	}

	JAP_government_faction_demands_trade_law_change = {

		priority = 1

		icon = GFX_decision_JAP_civic_faction

		allowed = { always = no }

		visible = {
		}

		available = {
			hidden_trigger = { always = no }
		}

		days_mission_timeout = 365

		is_good = no

		#fire_only_once = yes

		#cancel_if_not_visible = yes
		cancel_trigger = {
			IF = {
				limit = {
					has_country_flag = JAP_is_on_closed_economy_flag
				}
				OR = {
					has_idea = limited_exports
					has_idea = export_focus
					has_idea = free_trade
				}
			}
			ELSE_IF = {
				limit = {
					has_country_flag = JAP_is_on_limited_exports_flag
				}
				OR = {
					has_idea = export_focus
					has_idea = free_trade
				}
			}
			ELSE_IF = {
				limit = {
					has_country_flag = JAP_is_on_export_focus_flag
				}
				has_idea = free_trade
			}
		}

		cancel_effect = {

			add_political_power = 15

			add_timed_idea = {
				idea = JAP_temporary_infra_construction_bonus_idea
				days = 90 
			}	

			custom_effect_tooltip = generic_skip_one_line_tt

			JAP_faction_demand_finalize_mission_effect = yes
			JAP_faction_demand_add_to_successful_missions = yes
			JAP_small_government_faction_gain = yes
			
			hidden_effect = {
				IF = {
					limit = {
						has_country_flag = JAP_is_on_closed_economy_flag
					}
					clr_country_flag = JAP_is_on_closed_economy_flag
				}
				ELSE_IF = {
					limit = {
						has_country_flag = JAP_is_on_limited_exports_flag
					}
					clr_country_flag = JAP_is_on_limited_exports_flag
				}
				ELSE_IF = {
					limit = {
						has_country_flag = JAP_is_on_export_focus_flag
					}
					clr_country_flag = JAP_is_on_export_focus_flag
				}
			}
		}

		timeout_effect = { #Fails
			#set_variable = { JAP_government_faction_demand_failure = 1 } #This is to keep track of what effects failure will give, since we're using the same event for all Government failures
			country_event = {
				id = SEA_imperial_influence_events.400
				hours = 1
			}
			effect_tooltip = {
				JAP_small_government_faction_loss = yes
			}
			hidden_effect = {
				IF = {
					limit = {
						has_country_flag = JAP_is_on_closed_economy_flag
					}
					clr_country_flag = JAP_is_on_closed_economy_flag
				}
				ELSE_IF = {
					limit = {
						has_country_flag = JAP_is_on_limited_exports_flag
					}
					clr_country_flag = JAP_is_on_limited_exports_flag
				}
				ELSE_IF = {
					limit = {
						has_country_flag = JAP_is_on_export_focus_flag
					}
					clr_country_flag = JAP_is_on_export_focus_flag
				}
			}
		}
	}

	JAP_government_faction_demands_limited_army_influence = {

		priority = 1

		icon = GFX_decision_JAP_civic_faction

		allowed = { always = no }

		visible = {
		}

		available = {
			hidden_trigger = { always = no }
		}

		days_mission_timeout = 365

		is_good = no

		#fire_only_once = yes

		#cancel_if_not_visible = yes
		cancel_trigger = {
			JAP_army_faction_is_at_most_meddling = yes
		}

		cancel_effect = {

			add_political_power = 50

			add_stability = 0.05

			custom_effect_tooltip = generic_skip_one_line_tt

			clr_country_flag = JAP_government_faction_demands_more_influence
			JAP_faction_demand_finalize_mission_effect = yes
			JAP_faction_demand_add_to_successful_missions = yes
			JAP_small_government_faction_gain = yes
			
		}

		timeout_effect = { #Fails
			#set_variable = { JAP_government_faction_demand_failure = 1 } #This is to keep track of what effects failure will give, since we're using the same event for all Government failures
			clr_country_flag = JAP_government_faction_demands_more_influence
			country_event = {
				id = SEA_imperial_influence_events.400
				hours = 1
			}
			effect_tooltip = {
				JAP_small_government_faction_loss = yes
				
			}
		}
	}

	JAP_government_faction_demands_limited_navy_influence = {

		priority = 1

		icon = GFX_decision_JAP_civic_faction

		allowed = { always = no }

		visible = {
		}

		available = {
			hidden_trigger = { always = no }
		}

		days_mission_timeout = 365

		is_good = no

		#fire_only_once = yes

		#cancel_if_not_visible = yes
		cancel_trigger = {
			JAP_naval_faction_is_at_most_meddling = yes
		}

		cancel_effect = {

			add_political_power = 50

			add_stability = 0.05

			custom_effect_tooltip = generic_skip_one_line_tt

			clr_country_flag = JAP_government_faction_demands_more_influence
			JAP_faction_demand_finalize_mission_effect = yes
			JAP_faction_demand_add_to_successful_missions = yes
			JAP_small_government_faction_gain = yes
			
		}

		timeout_effect = { #Fails
			#set_variable = { JAP_government_faction_demand_failure = 1 } #This is to keep track of what effects failure will give, since we're using the same event for all Government failures
			clr_country_flag = JAP_government_faction_demands_more_influence
			country_event = {
				id = SEA_imperial_influence_events.400
				hours = 1
			}
			effect_tooltip = {
				JAP_small_government_faction_loss = yes
				
			}
		}
	}

	JAP_government_faction_demands_limited_zaibatsu_influence = {

		priority = 1

		icon = GFX_decision_JAP_civic_faction

		allowed = { always = no }

		visible = {
		}

		available = {
			hidden_trigger = { always = no }
		}

		days_mission_timeout = 365

		is_good = no

		#fire_only_once = yes

		#cancel_if_not_visible = yes
		cancel_trigger = {
			JAP_zaibatsu_faction_is_at_most_meddling = yes
		}

		cancel_effect = {

			add_political_power = 50

			add_stability = 0.05

			custom_effect_tooltip = generic_skip_one_line_tt

			clr_country_flag = JAP_government_faction_demands_more_influence
			JAP_faction_demand_finalize_mission_effect = yes
			JAP_faction_demand_add_to_successful_missions = yes
			JAP_small_government_faction_gain = yes
			
		}

		timeout_effect = { #Fails
			#set_variable = { JAP_government_faction_demand_failure = 1 } #This is to keep track of what effects failure will give, since we're using the same event for all Government failures
			clr_country_flag = JAP_government_faction_demands_more_influence
			country_event = {
				id = SEA_imperial_influence_events.400
				hours = 1
			}
			effect_tooltip = {
				JAP_small_government_faction_loss = yes
				
			}
		}
	}
}




# The Propaganda Department
JAP_the_propaganda_department_decisions = {

	# Establish Contact with Thubten Kunphela
	JAP_estabish_contact_with_thubten_kumphela_decision  = {

		priority = 15

		icon = GFX_decision_generic_political_discourse

		ai_will_do = {
			base = 50
		}
	
		allowed = {  
			original_tag = JAP 
		}

		visible = { 
			has_completed_focus = JAP_an_expedition_to_tibet
			OR = {
				has_government = neutrality
				has_government = fascism
			}
			TIB = {
				exists = yes
				is_subject = no
				NOT = {
					has_government = fascism
				}
			}
		}
	
		available = {
			
		}

		#days_remove = 70

		#days_re_enable = 180

		cost = 50

		cancel_trigger = {
		}

        cancel_effect = {
        }

		modifier = {
		}

		complete_effect = { 

			TIB = {
				country_event = {
					id = SEA_japan_foreign_policy.24
					hours = 12
					random_hours = 24
				}	
			}	
			effect_tooltip = {
				TIB = {
					add_stability = -0.03
					
					add_popularity = {
						ideology = fascism
						popularity = 0.05
					}	
				}
			}

			hidden_effect = {
				set_country_flag = JAP_approached_the_tibet_impr_party_flag
			}

		}

		fire_only_once = yes

		remove_effect = {

		}

	}

	# Establish a Trongdra Regiment in Exile
	JAP_estabish_a_trongdra_regiment_in_exile  = {

		priority = 14

		icon = GFX_decision_generic_protection

		ai_will_do = {
			base = 50
		}
	
		allowed = {  
			original_tag = JAP 
		}

		visible = { 
			has_completed_focus = JAP_an_expedition_to_tibet
			OR = {
				has_government = neutrality
				has_government = fascism
			}
			TIB = {
				exists = yes
				is_subject = no
				NOT = {
					has_government = fascism
				}
			}
		}
	
		available = {
			has_country_flag = JAP_approached_the_tibet_impr_party_flag
		}

		#days_remove = 70

		#days_re_enable = 180

		cost = 25

		cancel_trigger = {
		}

        cancel_effect = {
        }

		modifier = {
		}

		complete_effect = { 

			TIB = {
				country_event = {
					id = SEA_japan_foreign_policy.25
					hours = 12
					random_hours = 24
				}	
			}	
			effect_tooltip = {
				TIB = {
					add_manpower = -500

					add_stability = -0.1
					
					add_popularity = {
						ideology = fascism
						popularity = 0.1
					}	
				}
			}

			hidden_effect = {
				set_country_flag = JAP_militarized_the_tibet_impr_party_flag
			}

		}

		fire_only_once = yes

		remove_effect = {

		}

	}
	
	# Influence the Tibetan People
	JAP_influence_tibetan_people_decision  = {

		priority = 10

		icon = GFX_decision_eng_propaganda_campaigns

		ai_will_do = {
			base = 50
		}
	
		allowed = {  
			original_tag = JAP 
		}

		visible = { 
			has_completed_focus = JAP_an_expedition_to_tibet
			OR = {
				has_government = neutrality
				has_government = fascism
			}
			TIB = {
				exists = yes
				is_subject = no
				NOT = {
					has_government = fascism
					has_idea = JAP_japanese_influence_growing_tibet_2
				}
			}
		}
	
		available = {
			has_country_flag = JAP_approached_the_tibet_impr_party_flag
		}

		#days_remove = 70

		days_re_enable = 180

		cost = 50

		cancel_trigger = {
		}

        cancel_effect = {
        }

		modifier = {
		}

		complete_effect = { 

			TIB = {
				country_event = {
					id = SEA_japan_foreign_policy.23
					hours = 12
					random_hours = 24
				}	
			}	
			effect_tooltip = {
				TIB = {
					add_timed_idea = {
						idea = JAP_japanese_influence_growing_tibet_2
						days = 176
					}		
				}
			}

		}

		fire_only_once = no

		remove_effect = {

		}

	}

	# Coup the Tibetan Government
	JAP_coup_the_tibetan_government_decision  = {

		priority = 12

		icon = GFX_decision_generic_civil_support

		ai_will_do = {
			base = 50
		}
	
		allowed = {  
			original_tag = JAP 
		}

		visible = { 
			has_completed_focus = JAP_an_expedition_to_tibet
			OR = {
				has_government = neutrality
				has_government = fascism
			}
			TIB = {
				exists = yes
				is_subject = no
				NOT = {
					has_government = fascism
				}
			}
		}
	
		available = {
			TIB = {
				fascism > 0.35
				is_subject = no
				NOT = {
					has_government = fascism
				}
			}
			has_country_flag = JAP_militarized_the_tibet_impr_party_flag
		}

		#days_remove = 70

		#days_re_enable = 180

		cost = 75

		cancel_trigger = {
		}

        cancel_effect = {
        }

		modifier = {
		}

		complete_effect = { 

			TIB = {
				country_event = {
					id = SEA_japan_foreign_policy.26
					hours = 12
					random_hours = 24
				}	
			}	
			custom_effect_tooltip = if_they_accept_tt
			effect_tooltip = {
				puppet = TIB
				TIB = {
					set_politics = {
						ruling_party = fascism
						elections_allowed = no
					}		
					add_popularity = {
						ideology = fascism
						popularity = 0.2
					}	
					add_manpower = 2500
					army_experience = 50
				}
			}

			hidden_effect = {
				set_country_flag = JAP_militarized_the_tibet_impr_party_flag
			}

		}

		fire_only_once = yes

		remove_effect = {

		}

	}

	# Organize Tonarigumi in [FROM.GetNameDef]
	JAP_create_subject_tonarigumi = {
		icon = GFX_decision_generic_military

		priority = 1
	
		allowed = {
			original_tag = JAP
		}

		ai_will_do = {
			base = 25
		}
		
		visible = {
			has_completed_focus = JAP_formalize_the_tonarigumi
			any_subject_country = {
				NOT = {
					has_idea = JAP_subject_tonarigumi_idea
				}
			}
		}
		available = {
			NOT = { has_country_flag = JAP_organizing_tonarigumi_in_progress }
		}

		target_root_trigger = { original_tag = JAP }

		#state_target = any_controlled_state
	    
	    target_trigger = {
	        FROM = {
	        	is_subject_of = ROOT
	        	NOT = {
	        		has_idea = JAP_subject_tonarigumi_idea
	        	}
	        }
	    }

	    on_map_mode = map_and_decisions_view 

	    cost = 25		
		fire_only_once = yes

		days_remove = 30

		complete_effect = {
			hidden_effect = {
				set_country_flag = { flag = JAP_organizing_tonarigumi_in_progress value = 1 days = 31 }
			}
		}
		remove_effect = {
			hidden_effect = {
				clr_country_flag = JAP_organizing_tonarigumi_in_progress
			}
			FROM = {
				add_ideas = JAP_subject_tonarigumi_idea
			}
		}

		cancel_trigger = {
			FROM = {
				NOT = { is_subject_of = ROOT }
			}
		}

		cancel_effect = {
			hidden_effect = {
				clr_country_flag = JAP_organizing_tonarigumi_in_progress
			}
		}
	}

	# Pull Back on Fanaticist Propaganda
	JAP_pull_back_on_fanatiscist_propaganda_decision  = {

		priority = 9

		icon = GFX_decision_hol_war_on_pacifism

		ai_will_do = {
			base = 0
		}
	
		allowed = {  
			original_tag = JAP 
		}

		visible = { 
			has_completed_focus = JAP_advance_one_hundred_million_fireballs
			has_idea = JAP_advance_one_hundred_million_fireballs_idea
		}
	
		available = {
		}

		#days_remove = 70

		#days_re_enable = 180

		cost = 50

		cancel_trigger = {
		}

        cancel_effect = {
        }

		modifier = {
		}

		complete_effect = { 

			remove_ideas = JAP_advance_one_hundred_million_fireballs_idea

			custom_effect_tooltip = generic_skip_one_line_tt

			add_popularity = {
				ideology = ROOT
				popularity = -0.1
			}	

		}

		fire_only_once = yes

		remove_effect = {

		}

	}

	# Promote Pro-Japanese Sentiment in §Y[FROM.GetNameDef]§!
	JAP_promote_pro_japanese_sentiment_decison = {
		icon = GFX_decision_eng_propaganda_campaigns

		priority = 2
	
		allowed = {
			original_tag = JAP
		}

		ai_will_do = {
			base = 5
		}
		
		visible = {
			has_completed_focus = JAP_east_asian_cooperative_society
		}
		available = {
		}

		target_root_trigger = { 
			original_tag = JAP 
		}

		target_array = global.asian_and_oceanian_countries
	    
	    target_trigger = {
	        FROM = {
	        	NOT = {
	        		has_war_with = ROOT
	        		is_subject_of = ROOT
	        	}
	        	NOT = {
	        		has_country_flag = JAP_has_already_attempted_to_influence_this_nation_flag
	        	}
	        }
	    }

	    on_map_mode = decision_view_only 

	    cost = 25		
		fire_only_once = yes

		days_remove = 30

		complete_effect = {
			hidden_effect = {
				set_country_flag = { flag = JAP_currently_spreading_pro_japanese_sentiments_flag value = 1 days = 31 }
			}
		}
		remove_effect = {
			hidden_effect = {
				clr_country_flag = JAP_currently_spreading_pro_japanese_sentiments_flag
			}
			FROM = {
				country_event = {
					id = SEA_japan_foreign_policy.36
					hours = 2
					random_hours = 4
				}		
				set_country_flag = JAP_has_already_attempted_to_influence_this_nation_flag	
			}
			custom_effect_tooltip = if_they_accept_tt
			effect_tooltip = {
				FROM = {
					add_offsite_building = {
						type = industrial_complex
						level = 2
					}	
					add_ideas = JAP_supported_pro_japanese_sentiments_idea
				}
				add_opinion_modifier = {
					target = FROM
					modifier = JAP_growing_pro_japanese_sentiment_opm
				}
			}
		}

		cancel_trigger = {
			FROM = {
				OR = {
					exists = no
					is_subject_of = ROOT
					has_war_with = ROOT
				}
			}
		}

		cancel_effect = {
			hidden_effect = {
				clr_country_flag = JAP_currently_spreading_pro_japanese_sentiments_flag
			}
		}
	}

	# Invest in §Y[FROM.GetNameDef]§! Natural Resources
	JAP_invest_in_colonial_resources_decison = {
		icon = GFX_decision_gre_investment_decisions

		priority = 0

		ai_will_do = {
			base = 5
		}
	
		allowed = {
			original_tag = JAP
		}
		
		visible = {
			has_completed_focus = JAP_east_asian_cooperative_society
		}

		available = {
			
		}

		target_root_trigger = { 
			NOT = { has_country_flag = JAP_currently_investing_in_states_natural_resources_flag }
		}

		target_array = global.asian_and_oceanian_countries
	    
	    target_trigger = {
	        FROM = {
	        	NOT = {
	        		has_war_with = ROOT
	        		is_subject_of = ROOT
	        	}
	        	has_country_flag = JAP_country_that_accepted_japanese_influence_flag
	        }
	    }

	    on_map_mode = decision_view_only 

	    cost = 50		
		fire_only_once = yes

		days_remove = 30

		complete_effect = {
			hidden_effect = {
				set_country_flag = { flag = JAP_currently_investing_in_states_natural_resources_flag value = 1 days = 31 }
			}
		}
		remove_effect = {
			hidden_effect = {
				clr_country_flag = JAP_currently_investing_in_states_natural_resources_flag
			}
			FROM = {
				country_event = {
					id = SEA_japan_foreign_policy.39
					hours = 2
					random_hours = 4
				}		
			}
			custom_effect_tooltip = if_they_accept_tt
			effect_tooltip = {
				FROM = {
					add_popularity = {
						ideology = fascism
						popularity = 0.05
					}	
					every_owned_state = {
						limit = {
							is_controlled_by = FROM
						}
						add_dynamic_modifier = {
							modifier = JAP_resource_extraction_investments_dm
						}
					}
				}
			}
		}

		cancel_trigger = {
			FROM = {
				OR = {
					exists = no
					has_war_with = ROOT
				}
			}
		}

		cancel_effect = {
			hidden_effect = {
				clr_country_flag = JAP_currently_investing_in_states_natural_resources_flag
			}
		}
	}

	# Infiltrate the lands of thr former Setsen Khanate
	JAP_infiltrate_setsen_khanate_lands_decision  = {

		priority = 30

		icon = GFX_decision_infiltrate_state

		ai_will_do = {
			base = 50
		}
	
		allowed = {  
			original_tag = JAP 
		}

		visible = { 
			has_completed_focus = JAP_a_mongol_volunteer_army
			OR = {
				has_government = neutrality
				has_government = fascism
			}
			MON = {
				exists = yes
				is_subject = no
				NOT = {
					has_government = neutrality
					has_government = fascism
				}
			}
		}
	
		available = {
			761 = {
				is_controlled_by_ROOT_or_ally = yes
			}
		}

		#days_remove = 70

		#days_re_enable = 180

		cost = 50

		cancel_trigger = {
		}

        cancel_effect = {
        }

		modifier = {
		}

		complete_effect = { 

			MON = {
				country_event = {
					id = SEA_japan_foreign_policy.53
					hours = 12
					random_hours = 24
				}	
			}	
			effect_tooltip = {
				MON = {
					add_stability = -0.05
					
					add_popularity = {
						ideology = fascism
						popularity = 0.05
					}	

					add_popularity = {
						ideology = neutrality
						popularity = 0.05
					}	

					add_manpower = -300
				}
			}

			hidden_effect = {
				set_country_flag = JAP_infiltrated_the_setsen_khanate_flag
			}

		}

		fire_only_once = yes

		remove_effect = {

		}

	}

	# Arms Anti-Communist Dissidents in Mongolia
	JAP_arm_anti_communist_mongol_dissidents_decision  = {

		priority = 29

		icon = GFX_decision_CHL_carabineros

		ai_will_do = {
			base = 50
		}
	
		allowed = {  
			original_tag = JAP 
		}

		visible = { 
			has_completed_focus = JAP_a_mongol_volunteer_army
			OR = {
				has_government = neutrality
				has_government = fascism
			}
			MON = {
				exists = yes
				is_subject = no
				NOT = {
					has_government = neutrality
					has_government = fascism
				}
			}
		}
	
		available = {
			has_country_flag = JAP_infiltrated_the_setsen_khanate_flag
		}

		#days_remove = 70

		#days_re_enable = 180

		cost = 50

		cancel_trigger = {
		}

        cancel_effect = {
        }

		modifier = {
		}

		complete_effect = { 

			MON = {
				country_event = {
					id = SEA_japan_foreign_policy.54
					hours = 12
					random_hours = 24
				}	
			}	
			effect_tooltip = {
				MON = {
					add_stability = -0.05
					
					add_popularity = {
						ideology = MON
						popularity = -0.1
					}	

					add_political_power = -50
				}
			}

			hidden_effect = {
				set_country_flag = JAP_armed_mongol_dissidents_flag_flag
			}

		}

		fire_only_once = yes

		remove_effect = {

		}

	}

	# Influence the Mongolian People
	JAP_influence_mongolian_people_decision  = {

		priority = 28

		icon = GFX_decision_eng_propaganda_campaigns

		ai_will_do = {
			base = 50
		}
	
		allowed = {  
			original_tag = JAP 
		}

		visible = { 
			has_completed_focus = JAP_a_mongol_volunteer_army
			OR = {
				has_government = neutrality
				has_government = fascism
			}
			MON = {
				exists = yes
				is_subject = no
				NOT = {
					has_government = neutrality
					has_government = fascism
				}
			}
		}
	
		available = {
			has_country_flag = JAP_infiltrated_the_setsen_khanate_flag
		}

		#days_remove = 70

		days_re_enable = 180

		cost = 50

		cancel_trigger = {
		}

        cancel_effect = {
        }

		modifier = {
		}

		complete_effect = { 

			MON = {
				country_event = {
					id = SEA_japan_foreign_policy.23
					hours = 12
					random_hours = 24
				}	
			}	
			effect_tooltip = {
				MON = {
					add_timed_idea = {
						idea = JAP_japanese_influence_growing_mongolia
						days = 176
					}		
				}
			}

		}

		fire_only_once = no

		remove_effect = {

		}

	}

	# Send Jodbajab to Mongolia
	JAP_send_jodbajab_to_mongolia_decision  = {

		priority = 27

		icon = GFX_decision_onmap_recruit_operative

		ai_will_do = {
			base = 50
		}
	
		allowed = {  
			original_tag = JAP 
		}

		visible = { 
			has_completed_focus = JAP_a_mongol_volunteer_army
			NOT = {
				has_country_flag = JAP_sent_jonjurjab_to_mongolia
			}
			OR = {
				has_government = neutrality
				has_government = fascism
			}
			MON = {
				exists = yes
				is_subject = no
				NOT = {
					has_government = neutrality
					has_government = fascism
				}
			}
		}
	
		available = {
			has_country_flag = JAP_infiltrated_the_setsen_khanate_flag
			NOT = {
				has_country_flag = JAP_sent_jonjurjab_to_mongolia
			}
			MON = {
				custom_trigger_tooltip = {
					tooltip = JAP_send_collabs_to_mongolia_trigger_tt
					set_temp_variable = { MON_rw_support = party_popularity@neutrality }
					add_to_temp_variable = { MON_rw_support = party_popularity@fascism }
					check_variable = { MON_rw_support > 0.35 }
				}
			}
			OR = {
				MEN = {
					exists = yes
					is_ally_with = ROOT
				}
				MEN = {
					exists = no
				}
			}
		}

		fire_only_once = yes

		cost = 50

		complete_effect = { 

			custom_effect_tooltip = JAP_send_jodbajab_to_mongolia_decision_tt

			custom_effect_tooltip = generic_skip_one_line_tt

			MON = {
				country_event = {
					id = SEA_japan_foreign_policy.55
					hours = 12
					random_hours = 24
				}	
			}

			set_country_flag = JAP_sent_jodbajab_to_mongolia

		}

	}

	# Send Jonjurjab to Mongolia
	JAP_send_jonjurjab_to_mongolia_decision  = {

		priority = 26

		icon = GFX_decision_onmap_recruit_operative

		ai_will_do = {
			base = 50
		}
	
		allowed = {  
			original_tag = JAP 
		}

		visible = { 
			has_completed_focus = JAP_a_mongol_volunteer_army
			NOT = {
				has_country_flag = JAP_sent_jodbajab_to_mongolia
			}
			OR = {
				has_government = neutrality
				has_government = fascism
			}
			MON = {
				exists = yes
				is_subject = no
				NOT = {
					has_government = neutrality
					has_government = fascism
				}
			}
		}
	
		available = {
			has_country_flag = JAP_infiltrated_the_setsen_khanate_flag
			NOT = {
				has_country_flag = JAP_sent_jodbajab_to_mongolia
			}
			MON = {
				custom_trigger_tooltip = {
					tooltip = JAP_send_collabs_to_mongolia_trigger_tt
					set_temp_variable = { MON_rw_support = party_popularity@neutrality }
					add_to_temp_variable = { MON_rw_support = party_popularity@fascism }
					check_variable = { MON_rw_support > 0.35 }
				}
			}
			OR = {
				MAN = {
					exists = yes
					is_ally_with = ROOT
				}
				MAN = {
					exists = no
				}
			}
		}

		fire_only_once = yes

		cost = 50

		complete_effect = { 

			custom_effect_tooltip = JAP_send_jonjurjab_to_mongolia_decision_tt

			custom_effect_tooltip = generic_skip_one_line_tt

			MON = {
				country_event = {
					id = SEA_japan_foreign_policy.56
					hours = 12
					random_hours = 24
				}	
			}	

			set_country_flag = JAP_sent_jonjurjab_to_mongolia

		}

	}

	# Coup the Mongolian Government
	JAP_coup_the_mongolian_government_decision  = {

		priority = 25

		icon = GFX_decision_generic_tank

		ai_will_do = {
			base = 50
		}
	
		allowed = {  
			original_tag = JAP 
		}

		visible = { 
			has_completed_focus = JAP_a_mongol_volunteer_army
			OR = {
				has_country_flag = JAP_sent_jodbajab_to_mongolia
				has_country_flag = JAP_sent_jonjurjab_to_mongolia
			}
			OR = {
				has_government = neutrality
				has_government = fascism
			}
			MON = {
				exists = yes
				is_subject = no
				NOT = {
					has_government = neutrality
					has_government = fascism
				}
			}
		}
	
		available = {
			MON = {
				custom_trigger_tooltip = {
					tooltip = JAP_coup_mongolia_trigger_tt
					set_temp_variable = { MON_rw_support = party_popularity@neutrality }
					add_to_temp_variable = { MON_rw_support = party_popularity@fascism }
					check_variable = { MON_rw_support > 0.4 }
				}
				is_subject = no
				NOT = {
					has_government = neutrality
					has_government = fascism
				}
			}
			OR = {
				has_country_flag = JAP_sent_jodbajab_to_mongolia
				has_country_flag = JAP_sent_jonjurjab_to_mongolia
			}
		}

		cost = 75

		complete_effect = { 

			MON = {
				country_event = {
					id = SEA_japan_foreign_policy.57
					days = 2
					random_days = 2
				}	
			}	
			custom_effect_tooltip = if_they_accept_tt
			effect_tooltip = {
				puppet = MON
				MON = {
					set_politics = {
						ruling_party = fascism
						elections_allowed = no
					}	
					add_popularity = {
						ideology = neutrality
						popularity = 0.05
					}	
					add_popularity = {
						ideology = fascism
						popularity = 0.2
					}	
					add_manpower = 3000
					army_experience = 50
					add_political_power = 100
				}
			}

			hidden_effect = {
				set_country_flag = JAP_couped_mongolia_flag
			}

			custom_effect_tooltip = JAP_coup_the_mongolian_government_decision_tt

		}

		fire_only_once = yes

		remove_effect = {

		}

	}

	JAP_jeweled_spear_claim_decision = {

		priority = 30

		icon = GFX_decision_generic_planted_spear

		on_map_mode = map_and_decisions_view

		allowed = { 
		}

		highlight_states = {
			highlight_states_trigger = {
				is_owned_by = FROM
			}
		}

		target_trigger = {
			#Target is FROM
			FROM = {
				NOT = {
					is_ally_with = ROOT
				}
				capital_scope = {
					OR = {
						is_on_continent = asia
						is_on_continent = middle_east
						is_on_continent = australia
					}
				}
				NOT = {
					is_in_array = {
						array = country_whose_states_were_claimed_by_the_spear_array
						value = THIS
					}	
				}
			}
		}

		visible = {
			has_completed_focus = JAP_the_jeweled_spear_has_struck
			FROM = {
				any_owned_state = {
					NOT = { is_claimed_by = ROOT }
				}
			}
			OR = {
				any_controlled_state = {
					any_neighbor_state = {
						controller = {
							original_tag = FROM
						}
					}
				}
				any_subject_country = {
					any_controlled_state = {
						any_neighbor_state = {
							controller = {
								original_tag = FROM
							}
						}
					}
				}
				# This is the best way to also be able to target coastal nations with how the above targetting works
				FROM = {
					capital_scope = {
						is_coastal = yes
					}
				}
			}
		}

		available = {
			is_subject = no
			all_of_scopes = {
				array = struck_by_the_jeweled_spear_array 
				is_controlled_by = ROOT
				tooltip = JAP_jeweled_spear_claim_availability_tt 
			}
		}

		cost = 10

		fire_only_once = yes

		ai_will_do = {
			base = 10
		}

		complete_effect = {

			hidden_effect = {
				FROM = {
					add_to_array = {
						array = country_whose_states_were_claimed_by_the_spear_array
						value = PREV #optional, if not defined adds scope
					} 
				}
				FROM = {
					capital_scope = {
						#add_to_array = {
						#	array = claimed_countrys_capital_used_to_expel_barbarians_array
						#	value = PREV #optional, if not defined adds scope
						#} 
						set_state_flag = can_renew_sonno_joi_flag
					}
				}
			}

			every_state = {
				limit = { 
					is_owned_by = FROM 
					OR = {
						is_on_continent = asia
						is_on_continent = middle_east
						is_on_continent = australia
					}
				}
				ROOT = { 
					add_to_array = {
						array = struck_by_the_jeweled_spear_array
						value = PREV #optional, if not defined adds scope
					} 
				}
				add_claim_by = ROOT
			}

			IF = {
				limit = {
					NOT = {
						has_war_with = FROM
					}
				}
				custom_effect_tooltip = generic_skip_one_line_tt
				create_wargoal = {
					type = annex_everything
					target = FROM
				}	
			}

		}	
	}

	JAP_core_asian_state = {

		icon = GFX_decision_generic_form_nation

		priority = 20

		highlight_states = {
			highlight_state_targets = {
				state = FROM 
			} 
		}
	
		allowed = {
			original_tag = JAP
		}
		
		visible = {
			has_completed_focus = JAP_hakko_ichiu
		}
		
		available = {
			FROM = {
				NOT = { has_state_flag = JAP_coring_this_asian_state_in_progress_flag }
			}
			FROM = {
				compliance > 50
			}
		}

		state_target = any_controlled_state
	    
	    target_trigger = {
	        FROM = {
	        	NOT = { is_core_of = ROOT }
	        	is_fully_controlled_by = ROOT
	        	OR = {
	        		is_owned_by = ROOT
	        		is_claimed_by = ROOT
	        	}
	        	OR = {
	        		is_on_continent = asia
	        		is_on_continent = middle_east
	        		is_on_continent = australia
	        	}
	        	OR = {
	        		any_neighbor_state = {
	        			is_core_of = ROOT
	        		}
	        		is_coastal = yes
	        	}
	        	NOT = {
	        		OR = {
	        			region = 264
	        			region = 40
	        			region = 137
	        			region = 135
	        			region = 138
	        			region = 134
	        			region = 25
	        		}
	        	}
	        }
	    }
	    on_map_mode = map_only

	    cost = 30		

		fire_only_once = yes

		days_remove = 70

		complete_effect = {
			hidden_effect = {
				FROM = {
					set_state_flag = { flag = JAP_coring_this_asian_state_in_progress_flag value = 1 days = 31 }
				}
			}
		}

		remove_effect = {
			hidden_effect = {
				FROM = {
					clr_state_flag = JAP_coring_this_asian_state_in_progress_flag
				}
			}

			FROM = {
				add_core_of = ROOT
			}
			
		}

		cancel_trigger = {
			FROM = {
				NOT = { is_fully_controlled_by = ROOT }
			}
		}

		cancel_effect = {
			hidden_effect = {
				FROM = {
					clr_state_flag = JAP_coring_this_asian_state_in_progress_flag
				}
			}
		}
	}


}

# The Co-Prosperity Sphere
JAP_the_co_prosperity_sphere_decisions = {
	
	# Hand Mongol States over to the [MEN.GetAdjective] Administration
	JAP_hand_mongol_states_to_mengkukuo_decision  = {

		priority = 5

		icon = GFX_decision_SWI_support_humanitarian_efforts

		target_root_trigger = { original_tag = JAP }

		target_trigger = {
			#Target is FROM
			FROM = {
				tag = MEN
				is_subject_of = ROOT
			}
		}

		ai_will_do = {
			base = 100
		}
	
		allowed = {  
			original_tag = JAP 
		}

		visible = { 
			has_completed_focus = JAP_mongol_autonomous_state
			OR = {
				has_government = neutrality
				has_government = fascism
			}
			any_controlled_state = {
				OR = {
					state = 818
					state = 817
					state = 330
					state = 820
					state = 819
					state = 564
					state = 329
					state = 654
					state = 760
					state = 756
					state = 621
					state = 746
					state = 612
					state = 611
					state = 761
					state = 563
					state = 566
					state = 616
				}
			}
		}
	
		available = {
			any_controlled_state = {
				OR = {
					state = 818
					state = 817
					state = 330
					state = 820
					state = 819
					state = 564
					state = 329
					state = 654
					state = 760
					state = 756
					state = 621
					state = 746
					state = 612
					state = 611
					state = 761
					state = 563
					state = 566
					state = 616
				}
			}
			has_completed_focus = JAP_mongol_autonomous_state # To Show people why they have it
		}

		#days_remove = 70

		days_re_enable = 70

		cost = 15

		cancel_trigger = {
		}

        cancel_effect = {
        }

		modifier = {
		}

		complete_effect = { 

			FROM = {
				country_event = {
					id = SEA_japan_foreign_policy.28
					hours = 5
				}	
			}	
			custom_effect_tooltip = if_they_accept_tt
			effect_tooltip = {
				every_controlled_state = {
					limit = {
						OR = {
							state = 818
							state = 817
							state = 330
							state = 820
							state = 819
							state = 564
							state = 329
							state = 654
							state = 760
							state = 756
							state = 621
							state = 746
							state = 612
							state = 611
							state = 761
							state = 563
							state = 566
							state = 616
						}
					}
					transfer_state_to = FROM
				}
			}

		}

		fire_only_once = no

		remove_effect = {

		}

	}

	# Offer Economic Integration to §Y[FROM.GetName]§!
	JAP_GEACPS_economic_integration_decision = {
		priority = 3
		icon = GFX_decision_eng_trade_unions_support 

		ai_will_do = {
			base = 5
			modifier = {
				factor = 2
				any_enemy_country = {
					has_war_with = FROM
				}
			}
			modifier = {
				factor = 0.5
				FROM = {
					is_enemy_ideology = yes
				}
			}
			modifier = {
				factor = 2
				FROM = {
					has_government = ROOT
				}
			}
			modifier = {
				factor = 2
				strength_ratio = {
				    tag = FROM
				    ratio < 0.75
				}
			}
			modifier = {
				factor = 2
				strength_ratio = {
				    tag = FROM
				    ratio < 0.5
				}
			}
		}

		target_array = ROOT.allies

		target_trigger = {
			FROM = {
				NOT = {
					original_tag = JAP
				}
				capital_scope = { 
					OR = {
						is_on_continent = asia 
						is_on_continent = australia
					}
				}
				is_subject = no
				has_idea = JAP_yen_bloc_idea
				NOT = {
					has_country_flag = JAP_has_sent_invitation_for_integration_once_already_flag
					has_country_flag = JAP_country_that_rejected_economic_integration_flag
				}
			}
		}

		available = {
			fighting_army_strength_ratio = {
			    tag = FROM
			    ratio > 2
			}
		}

		visible = {	
			has_completed_focus = JAP_develop_the_yen_bloc
		}

		fire_only_once = yes

		cost = 100

		complete_effect = {
			FROM = {
				country_event = { id = SEA_japan_foreign_policy.45 days = 1 } 
				set_country_flag = JAP_has_sent_invitation_for_integration_once_already_flag
			}

			custom_effect_tooltip = if_they_accept_tt

			effect_tooltip = {
				puppet = {
					target = FROM
					end_wars = no
					end_civil_wars = no
				}		 
			}
		}
	}

	# Develop §Y[FROM.GetAdjective]§! Industries
	JAP_GEACPS_develop_member_industry_decision = {
		priority = 1
		icon = GFX_decision_hol_attract_foreign_investors 

		ai_will_do = {
			base = 10
		}

		target_array = ROOT.allies

		target_trigger = {
			FROM = {
				NOT = {
					original_tag = JAP
				}
				capital_scope = { 
					OR = {
						is_on_continent = asia 
						is_on_continent = australia
					}
				}
				NOT = {
					has_country_flag = JAP_has_developed_froms_industry_once_already_flag
				}
			}
		}

		available = {
			
		}

		visible = {	
			has_completed_focus = JAP_east_asia_development_board
		}

		fire_only_once = yes

		cost = 50

		complete_effect = {
			FROM = {
				country_event = { id = SEA_japan_foreign_policy.48 days = 1 } 
				set_country_flag = JAP_has_developed_froms_industry_once_already_flag
			}

			custom_effect_tooltip = if_they_accept_tt

			effect_tooltip = {
				FROM = {
					add_tech_bonus = {
						bonus = 0.5
						uses = 2
						category = industry
					}
				}
				random_state = {
					limit = {
						is_owned_and_controlled_by = FROM
						is_core_of = FROM
						free_building_slots = {
							building = industrial_complex
							size > 2
							include_locked = yes
						}	
					}
					add_extra_state_shared_building_slots = 2
					add_building_construction = {
						type = industrial_complex
						level = 2
						instant_build = yes
					}	
				}		 
			}
		}
	}

	# Integrate the §Y[FROM.GetAdjective]§! Civilian Administration
	JAP_annex_developed_puppet_decision = {
		icon = GFX_decision_eng_trade_unions_demand
		priority = 2

		ai_will_do = {
			base = 50
		}
		
		fire_only_once = yes

		target_array = ROOT.subjects

		target_trigger = {
			FROM = {
				capital_scope = { 
					OR = {
						is_on_continent = asia
						is_on_continent = australia
						is_on_continent = middle_east
					}
				}
				has_country_flag = JAP_has_developed_froms_industry_once_already_flag
				has_idea = JAP_yen_bloc_idea
			}
		}

		visible = {
			has_completed_focus = JAP_promote_pan_asianism
		}

		available = {
			is_subject = no
			is_faction_leader = yes
		}

		days_remove = 35

		cost = 100

		complete_effect = {
		}

		remove_effect = {
			FROM = {
				country_event = {
					id = SEA_japan_foreign_policy.50
					hours = 12
				}
			}
			custom_effect_tooltip = if_they_accept_tt
			effect_tooltip = {
				annex_country = {
					target = FROM
					transfer_troops = yes
				}	
				custom_effect_tooltip = JAP_annex_developed_puppet_decision_tt
			}
			
		}
	}

	# Hand Chinese States over to the [RNG.GetAdjective] Administration
	JAP_hand_chinese_states_to_the_reorganized_government_decision  = {

		priority = 8

		icon = GFX_decision_SWI_support_humanitarian_efforts

		target_root_trigger = { original_tag = JAP }

		targets = { RNG }

		target_trigger = {
			#Target is FROM
			FROM = {
				is_subject_of = ROOT
			}
		}

		ai_will_do = {
			base = 150
			modifier = {
				factor = 0
				has_political_power < 100
			}
			modifier = {
				factor = 0.5
				has_political_power < 125
			}
		}
	
		allowed = {  
			original_tag = JAP 
		}

		visible = { 
			has_completed_focus = JAP_reorganized_national_government
			any_controlled_state = {
				is_core_of = CHI
				is_fully_controlled_by = ROOT
				NOT = {
					is_owned_by = RNG
				}
				NOT = {
					state = 745 # Kwantung Leased Territory
					state = 609 # Easty Hebei
					state = 611 # South Chahar
					state = 612 # Chahar
					region = 155 # West Manchuria
					region = 242 # North Manchuria
					region = 243 # East Manchuria
					state = 728 # Gouangzhouwan
					state = 729 # Macau
					state = 326 # Hong Kong
					state = 743 # Qingdao
					state = 524 # Taiwan
					state = 1039 # Hebei-Chahar
					state = 591 # Hainan
				}
			}
		}
	
		available = {
			has_subject = RNG
		}

		days_re_enable = 70

		cost = 50

		cancel_trigger = {
		}

        cancel_effect = {
        }

		modifier = {
		}

		complete_effect = { 

			FROM = {
				country_event = {
					id = SEA_japan_foreign_policy.58
					hours = 2
				}	
			}	
			custom_effect_tooltip = if_they_accept_tt
			effect_tooltip = {
				every_controlled_state = {
					limit = {
						is_core_of = CHI
						is_fully_controlled_by = ROOT
						NOT = {
							is_owned_by = RNG
							is_owned_by = ROOT
						}
						NOT = {
							state = 745 # Kwantung Leased Territory
							state = 609 # Easty Hebei
							state = 611 # South Chahar
							state = 612 # Chahar
							region = 155 # West Manchuria
							region = 242 # North Manchuria
							region = 243 # East Manchuria
							state = 728 # Gouangzhouwan
							state = 729 # Macau
							state = 326 # Hong Kong
							state = 743 # Qingdao
							state = 524 # Taiwan
						}
					}
					#FROM = {
						set_state_controller_to = RNG
						add_contested_owner = RNG
						add_claim_by = RNG
					#}
				}

				custom_effect_tooltip = generic_skip_one_line_tt

				every_owned_state = {
					limit = {
						is_fully_controlled_by = ROOT
						is_core_of = CHI
						NOT = {
							is_owned_by = RNG
						}
						NOT = {
							state = 745 # Kwantung Leased Territory
							state = 609 # Easty Hebei
							state = 611 # South Chahar
							state = 612 # Chahar
							region = 155 # West Manchuria
							region = 242 # North Manchuria
							region = 243 # East Manchuria
							state = 728 # Gouangzhouwan
							state = 729 # Macau
							state = 326 # Hong Kong
							state = 743 # Qingdao
							state = 524 # Taiwan
						}
					}
					FROM = {
						transfer_state = PREV
					}
				}
			}

		}

		fire_only_once = no

		remove_effect = {

		}

	}

	# Merging the Chinese Puppet Administrations
	JAP_merge_our_chinese_puppets_decision = {

		priority = 7

		icon = GFX_decision_eng_trade_unions_support

		ai_will_do = {
			base = 250
			modifier = {
				factor = 0
				has_political_power < 150
			}
		}
	
		allowed = {  
			original_tag = JAP 
		}

		visible = { 
			has_completed_focus = JAP_reorganized_national_government
			has_subject = RNG
			any_country = {
				is_literally_china = yes
				NOT = {
					original_tag = RNG
				}
				is_subject_of = ROOT
				is_ai = yes
			}
		}
	
		available = {
			is_subject = no
		}

		days_re_enable = 180

		cost = 100

		cancel_trigger = {
		}

        cancel_effect = {
        }

		modifier = {
		}

		complete_effect = { 

			every_country = {
				limit = {
					is_literally_china = yes
					NOT = {
						original_tag = RNG
					}
					is_subject_of = ROOT
					is_ai = yes
				}
				country_event = {
					id = SEA_japan_foreign_policy.63
					hours = 8
					random_hours = 12
				}	
			}
			custom_effect_tooltip = if_they_accept_tt
			effect_tooltip = {
				every_country = {
					limit = {
						is_literally_china = yes
						NOT = {
							original_tag = RNG
						}
						is_subject_of = ROOT
						is_ai = yes
					}
					RNG = {
						annex_country = {
							target = PREV
							transfer_troops = yes
						}	
					}	
					every_state = {
						limit = {
							is_core_of = PREV
						}
						add_core_of = RNG
					}
				}
			}

		}

		fire_only_once = no

		remove_effect = {

		}

	}

	# Establish the State of Burma
	JAP_establish_the_state_of_burma_decision = {
	
		priority = 50
	
		icon = GFX_decision_generic_nationalism
	
		ai_will_do = {
			base = 800
		}

		highlight_states = {
			highlight_state_targets = {
				state = 993
				state = 999
				state = 998
				state = 288
				state = 640
				state = 997
				state = 996
				state = 995
				state = 994
			}
		}
	
		allowed = {  
			original_tag = JAP
		}
	
		visible = { 
			has_completed_focus = JAP_strike_the_southern_road
			NOT = { has_country_flag = JAP_created_state_of_burma_flag }
		} 
	
		available = {
			is_subject = no
			OR = {
				BRM = {
					exists = no
				}
				BRM = {
					is_subject = yes
					has_war_with = ROOT
					has_civil_war = no
				}
			}
			BRM = {
				any_core_state = {
					is_fully_controlled_by = ROOT
				}
			}
		}
	
		cost = 25

		complete_effect = {

			IF = {
				limit = {
					BRM = {
						exists = no
					}
				}
				BRM = {
					every_core_state = {
						limit = {
							is_controlled_by_ROOT_or_subject = yes
						}
						transfer_state_to = BRM
					}
				}
				set_autonomy = {
					target = BRM
					autonomous_state = autonomy_wtt_imperial_protectorate
					end_wars = no
					end_civil_wars = no
				}
				BRM = {
					country_event = {
						id = SEA_japan_foreign_policy.59
						hours = 2
					}	
				}
			}
			ELSE = {
				hidden_effect = {
					BRM = {
						every_core_state = {
							limit = {
								controller = {
									OR = {
										original_tag = ROOT
										is_subject_of = ROOT
									}
								}
							}
							set_state_flag = is_state_that_should_go_to_japanese_burma_flag 
						}
					}
				}
				BRM = {
					country_event = {
						id = SEA_japan_foreign_policy.60
						hours = 1
					}	
				}
			}

			hidden_effect = {
				set_country_flag = JAP_created_state_of_burma_flag 
			}
		}
	
	}

	# Establish the Provisional Government of Free India
	JAP_establish_the_provisional_government_of_free_india_decision = {
	
		priority = 45
	
		icon = GFX_decision_generic_nationalism
	
		ai_will_do = {
			base = 800
		}
	
		allowed = {  
			original_tag = JAP
		}
	
		visible = { 
			has_completed_focus = JAP_strike_the_southern_road
			NOT = { has_country_flag = JAP_created_provisional_government_of_free_india_flag }
		} 
	
		available = {
			is_subject = no
			OR = {
				RAJ = {
					exists = no
				}
				RAJ = {
					is_subject = yes
					has_war_with = ROOT
					has_civil_war = no
				}
			}
			RAJ = {
				any_core_state = {
					is_fully_controlled_by = ROOT
				}
			}
		}
	
		cost = 25

		complete_effect = {

			IF = {
				limit = {
					RAJ = {
						exists = no
					}
				}
				RAJ = {
					every_core_state = {
						limit = {
							is_controlled_by_ROOT_or_subject = yes
						}
						transfer_state_to = RAJ
					}
				}
				set_autonomy = {
					target = RAJ
					autonomous_state = autonomy_wtt_imperial_protectorate
					end_wars = no
					end_civil_wars = no
				}
				RAJ = {
					country_event = {
						id = SEA_japan_foreign_policy.66
						hours = 2
					}	
				}
			}
			ELSE = {
				hidden_effect = {
					RAJ = {
						every_core_state = {
							limit = {
								controller = {
									OR = {
										original_tag = ROOT
										is_subject_of = ROOT
									}
								}
							}
							set_state_flag = is_state_that_should_go_to_japanese_azad_hind_flag 
						}
					}
					every_state = {
						limit = {
							is_in_array = {
							    array = RAJ.owned_states_at_game_start
							    value = THIS
							}
							controller = {
								OR = {
									original_tag = ROOT
									is_subject_of = ROOT
								}
							}
						}
						set_state_flag = is_state_that_should_go_to_japanese_azad_hind_flag 
					}
				}
				RAJ = {
					country_event = {
						id = SEA_japan_foreign_policy.67
						hours = 1
					}	
				}
			}

			hidden_effect = {
				set_country_flag = JAP_created_provisional_government_of_free_india_flag 
			}
		}
	
	}

	# Establish the Second Philippine Republic
	JAP_establish_the_second_philippine_republic_decision = {
	
		priority = 40
	
		icon = GFX_decision_generic_nationalism
	
		ai_will_do = {
			base = 800
		}

		highlight_states = {
			highlight_state_targets = {
				state = 623
				state = 1027
				state = 327
				state = 626
				state = 624
				state = 625
				state = 628
				state = 1026
				state = 627
				state = 1025
			}
		}
	
		allowed = {  
			original_tag = JAP
		}
	
		visible = { 
			has_completed_focus = JAP_strike_the_southern_road
			NOT = { has_country_flag = JAP_created_second_philippine_republic_flag }
		} 
	
		available = {
			is_subject = no
			OR = {
				PHI = {
					exists = no
				}
				PHI = {
					is_subject = yes
					has_war_with = ROOT
					has_civil_war = no
				}
			}
			PHI = {
				any_core_state = {
					is_fully_controlled_by = ROOT
				}
			}
		}
	
		cost = 25

		complete_effect = {

			IF = {
				limit = {
					PHI = {
						exists = no
					}
				}
				PHI = {
					every_core_state = {
						limit = {
							is_controlled_by_ROOT_or_subject = yes
						}
						transfer_state_to = PHI
					}
				}
				set_autonomy = {
					target = PHI
					autonomous_state = autonomy_wtt_imperial_protectorate
					end_wars = no
					end_civil_wars = no
				}
				PHI = {
					country_event = {
						id = SEA_japan_foreign_policy.68
						hours = 2
					}	
				}
			}
			ELSE = {
				random_state = {
					limit = {
						is_core_of = PHI
						is_controlled_by = ROOT
					}
					transfer_state_to = PSR
					add_core_of = PSR
				}
				PHI = {
					every_core_state = {
						add_claim_by = PSR
					}
				}
				every_state = {
					limit = {
						is_core_of = PHI
						is_controlled_by = ROOT
					}
					set_state_controller_to = PSR
				}

				custom_effect_tooltip =  generic_skip_one_line_tt

				set_autonomy = {
					target = PSR
					autonomous_state = autonomy_wtt_imperial_protectorate
					end_wars = no
					end_civil_wars = no
				}

				IF = {
					limit = {
						PHI = {
							NOT = {
								has_country_leader = {
									ruling_only = yes
									character = PHI_jose_laurel
								}	
							}
						}
					}
				    PHI = {  
			            PHI_jose_laurel = {
			                set_nationality = PSR
			                # Transfers to breakaway
			            }
		        	}
				}
				ELSE = {
				    PHI = {  
			            PHI_artemio_ricarte = {
			                set_nationality = PSR
			                # Transfers to breakaway
			            }
		        	}
				}

				PSR = {
					country_event = {
						id = SEA_japan_foreign_policy.135
						hours = 1
					}
				}

				#PHI = {
				#	country_event = {
				#		id = SEA_japan_foreign_policy.69
				#		hours = 1
				#	}	
				#}
			}

			hidden_effect = {
				set_country_flag = JAP_created_second_philippine_republic_flag 
			}
		}
	
	}

	JAP_establish_kingdoms_of_annam_and_cambodia_decision = {

		icon = GFX_decision_generic_operation

		allowed = {
			original_tag = JAP
		}

		highlight_states = {
			highlight_state_targets = {
				state = 671
				state = 1017
				state = 670
				state = 741
				state = 286
			}
		}

		priority = 30

		fire_only_once = yes

		cost = 30

		visible = {
			has_completed_focus = JAP_sea_greater_east_asian_co_properity_sphere
			VIN = {
				exists = no
			}
			CAM = {
				exists = no
			}
			NOT = {
				has_country_flag = JAP_disposed_of_initial_indochina_land_disposal_plan_flag
			}
		}

		available = {
			
			671 = {
				is_controlled_by_ROOT_or_subject = yes
			}
			1017 = {
				is_controlled_by_ROOT_or_subject = yes
			}
			670 = {
				is_controlled_by_ROOT_or_subject = yes
			}
			741 = {
				is_controlled_by_ROOT_or_subject = yes
			}
			286 = {
				is_controlled_by_ROOT_or_subject = yes
			}

		}

		complete_effect = {

			custom_effect_tooltip = kingdoms_of_annam_and_cambodia_tt

			hidden_effect = {

				# Vietnamese+ States
				every_state = {
					limit = {
						OR = {
							state = 671
							state = 1017
							state = 670
						}
					}
					transfer_state_to = VIN
					add_core_of = VIN
				}

				# Cambodian States
				every_state = {
					limit = {
						OR = {
							state = 741
							state = 286
						}
					}
					transfer_state_to = CAM
					add_core_of = CAM
				}

				set_autonomy = {
					target = VIN
					autonomous_state = autonomy_wtt_imperial_protectorate
					end_wars = no
					end_civil_wars = no
				}

				set_autonomy = {
					target = CAM
					autonomous_state = autonomy_wtt_imperial_protectorate
					end_wars = no
					end_civil_wars = no
				}

				VIN = {
					set_cosmetic_tag = VIN_kingdom_of_annam_tag
					JAP_setup_faction_wide_aoe_effects_root_this = yes
					set_capital = {
						state = 1017
						remember_old_capital = yes
					}
				}

				CAM = {
					set_cosmetic_tag = CAM_kingdom_of_cambodia_tag
					JAP_setup_faction_wide_aoe_effects_root_this = yes
				}

				set_country_flag = JAP_went_with_initial_sea_land_disposition_plan_flag
				
			}
		}

		ai_will_do = {
			base = 500 
			modifier = {
				add = -500
				is_historical_focus_on = yes # This was the initial but discarded plan for division
			}
		}
	}

	JAP_establish_empire_of_vietnam_decision = {

		icon = GFX_decision_JAP_establish_empire_of_vietnam

		allowed = {
			original_tag = JAP
		}

		highlight_states = {
			highlight_state_targets = {
				state = 671
				state = 1017
				state = 286
			}
		}

		priority = 29

		fire_only_once = yes

		cost = 10

		visible = {
			has_completed_focus = JAP_sea_greater_east_asian_co_properity_sphere
			VIN = {
				exists = no
			}
		}

		available = {
			
			671 = {
				is_controlled_by_ROOT_or_subject = yes
			}
			1017 = {
				is_controlled_by_ROOT_or_subject = yes
			}
			286 = {
				is_controlled_by_ROOT_or_subject = yes
			}

		}

		complete_effect = {

			custom_effect_tooltip = empire_of_vietnam_tt

			hidden_effect = {

				# Vietnamese States
				every_state = {
					limit = {
						OR = {
							state = 671
							state = 1017
							state = 286
						}
					}
					transfer_state_to = VIN
					add_core_of = VIN
				}

				set_autonomy = {
					target = VIN
					autonomous_state = autonomy_wtt_imperial_protectorate
					end_wars = no
					end_civil_wars = no
				}

				VIN = {
					set_cosmetic_tag = VIN_empire_of_vietnam_tag
					JAP_setup_faction_wide_aoe_effects_root_this = yes
					set_capital = {
						state = 1017
						remember_old_capital = yes
					}
				}

				IF = {
					limit = {
						NOT = {
							has_country_flag = JAP_disposed_of_initial_indochina_land_disposal_plan_flag
						}
					}
					set_country_flag = JAP_disposed_of_initial_indochina_land_disposal_plan_flag
				}
				
			}
		}

		ai_will_do = {
			base = 500 
		}

	}

	JAP_establish_kingdom_of_kampuchea_decision = {

		icon = GFX_decision_JAP_establish_kingdom_of_kampuchea

		allowed = {
			original_tag = JAP
		}

		highlight_states = {
			highlight_state_targets = {
				state = 741
			}
		}

		priority = 28

		fire_only_once = yes

		cost = 10

		visible = {
			has_completed_focus = JAP_sea_greater_east_asian_co_properity_sphere
			CAM = {
				exists = no
			}
		}

		available = {
			
			741 = {
				is_controlled_by_ROOT_or_subject = yes
			}

		}

		complete_effect = {

			custom_effect_tooltip = kingdom_of_kampuchea_tt

			hidden_effect = {

				# Cambodian States
				741 = {
					transfer_state_to = CAM
					add_core_of = CAM
				}

				set_autonomy = {
					target = CAM
					autonomous_state = autonomy_wtt_imperial_protectorate
					end_wars = no
					end_civil_wars = no
				}

				CAM = {
					set_cosmetic_tag = CAM_kingdom_of_kampuchea_tag
					JAP_setup_faction_wide_aoe_effects_root_this = yes
				}

				IF = {
					limit = {
						NOT = {
							has_country_flag = JAP_disposed_of_initial_indochina_land_disposal_plan_flag
						}
					}
					set_country_flag = JAP_disposed_of_initial_indochina_land_disposal_plan_flag
				}
				
			}
		}

		ai_will_do = {
			base = 500 
		}

	}

	JAP_establish_kingdom_of_luang_prabang_decision = {

		icon = GFX_decision_JAP_establish_kingdom_of_luang_prabang

		allowed = {
			original_tag = JAP
		}

		highlight_states = {
			highlight_state_targets = {
				state = 670
			}
		}

		priority = 27

		fire_only_once = yes

		cost = 10

		visible = {
			has_completed_focus = JAP_sea_greater_east_asian_co_properity_sphere
			LAO = {
				exists = no
			}
			NOT = {
				has_country_flag = JAP_went_with_initial_sea_land_disposition_plan_flag
			}
		}

		available = {
			
			670 = {
				is_controlled_by_ROOT_or_subject = yes
			}

		}

		complete_effect = {

			custom_effect_tooltip = kingdom_of_luang_prabang_tt

			hidden_effect = {

				# Laotian States
				670 = {
					transfer_state_to = LAO
					add_core_of = LAO
				}

				set_autonomy = {
					target = LAO
					autonomous_state = autonomy_wtt_imperial_protectorate
					end_wars = no
					end_civil_wars = no
				}

				LAO = {
					set_cosmetic_tag = LAO_kingdom_of_luang_prabang_tag
					JAP_setup_faction_wide_aoe_effects_root_this = yes
				}

				IF = {
					limit = {
						NOT = {
							has_country_flag = JAP_disposed_of_initial_indochina_land_disposal_plan_flag
						}
					}
					set_country_flag = JAP_disposed_of_initial_indochina_land_disposal_plan_flag
				}
				
			}
		}

		ai_will_do = {
			base = 500 
		}

	}

	JAP_establish_state_of_ceylon_decision = {

		icon = GFX_decision_JAP_establish_state_of_ceylon

		allowed = {
			original_tag = JAP
		}

		highlight_states = {
			highlight_state_targets = {
				state = 422
			}
		}

		priority = 26

		fire_only_once = yes

		cost = 10

		visible = {
			has_completed_focus = JAP_sea_greater_east_asian_co_properity_sphere
			SRL = {
				exists = no
			}
		}

		available = {
			
			422 = {
				is_controlled_by_ROOT_or_subject = yes
			}

		}

		complete_effect = {

			custom_effect_tooltip = state_of_ceylon_tt

			hidden_effect = {

				# Sri Lankan States
				422 = {
					transfer_state_to = SRL
					add_core_of = SRL
				}

				set_autonomy = {
					target = SRL
					autonomous_state = autonomy_wtt_imperial_protectorate
					end_wars = no
					end_civil_wars = no
				}

				SRL = {
					set_cosmetic_tag = SRL_state_of_ceylon_tag
					JAP_setup_faction_wide_aoe_effects_root_this = yes
				}
				
			}
		}

		ai_will_do = {
			base = 500 
		}

	}

	# Organize the Timorese Black Columns
	JAP_organize_timorese_black_columns_decision  = {

		priority = 25

		icon = GFX_decision_SWE_set_army_budget

		ai_will_do = {
			base = 10
		}
	
		allowed = {  
			original_tag = JAP 
		}

		visible = { 
			OR = {
				721 = {
					is_controlled_by = ROOT
				}
				AND = {
					has_subject = TML
					TML = {
						controls_state = 721
					}
				}
			}
		}
	
		available = {
			has_war = yes
		}

		#days_remove = 70

		#days_re_enable = 180

		cost = 15

		cancel_trigger = {
		}

        cancel_effect = {
        }

		modifier = {
		}

		complete_effect = { 

			IF = {
				limit = {
					721 = {
						is_controlled_by = ROOT
					}
				}

				hidden_effect = {

					delete_unit_template_and_units = {
						division_template = "Colunas Negras"
						disband = yes #if yes, will refund equipment/manpower.
					}

					division_template = {
						name = "Colunas Negras"
						division_names_group = POR_INF_01
						role = garrison
						#template_counter = 90
						is_locked = no
						regiments = {
							infantry = { x = 0 y = 0 }
							infantry = { x = 0 y = 1 }
							infantry = { x = 0 y = 2 }
							infantry = { x = 1 y = 0 }
						}
						support = {
						}
					}

				}

				721 = {
					create_unit = {
					    division = "name = \"1. Colunas Negras\" division_template = \"Colunas Negras\" start_experience_factor = 0.3 start_equipment_factor = 0.5"
					    owner = ROOT
					}
					create_unit = {
					    division = "name = \"2. Colunas Negras\" division_template = \"Colunas Negras\" start_experience_factor = 0.3 start_equipment_factor = 0.5"
					    owner = ROOT
					}
				}
			}	
			ELSE_IF = {
				limit = {
					has_subject = TML
					TML = {
						controls_state = 721
					}
				}

				TML = {

					hidden_effect = {

						delete_unit_template_and_units = {
							division_template = "Colunas Negras"
							disband = yes #if yes, will refund equipment/manpower.
						}

						division_template = {
							name = "Colunas Negras"
							division_names_group = POR_INF_01
							role = garrison
							#template_counter = 90
							is_locked = no
							regiments = {
								infantry = { x = 0 y = 0 }
								infantry = { x = 0 y = 1 }
								infantry = { x = 0 y = 2 }
								infantry = { x = 1 y = 0 }
							}
							support = {
							}
						}

					}

					721 = {
						create_unit = {
						    division = "name = \"1. Colunas Negras\" division_template = \"Colunas Negras\" start_experience_factor = 0.3 start_equipment_factor = 0.5"
						    owner = ROOT
						}
						create_unit = {
						    division = "name = \"2. Colunas Negras\" division_template = \"Colunas Negras\" start_experience_factor = 0.3 start_equipment_factor = 0.5"
						    owner = ROOT
						}
					}

				}

			}

		}

		fire_only_once = yes

		remove_effect = {

		}

	}

	# Integrate Northern Karafuto
	JAP_integrate_northern_karafuto_decision  = {

		priority = 20

		icon = GFX_decision_generic_form_nation

		ai_will_do = {
			base = 10
		}

		highlight_states = {
			highlight_states_trigger = {
				state = 655
			}
		}
	
		allowed = {  
			original_tag = JAP 
		}

		visible = { 
			655 = {
				OR = {
					is_owned_by = JAP
					is_controlled_by = JAP
				}
				NOT = {
					is_core_of = ROOT
				}
			}
		}
	
		available = {
			controls_state = 655
		}

		cost = 30

		cancel_trigger = {
		}

        cancel_effect = {
        }

		modifier = {
		}

		complete_effect = { 

			655 = {
				add_core_of = ROOT
			}

		}

		fire_only_once = yes

		remove_effect = {

		}

	}

	# Empower the Yi Dynasty
	JAP_empower_the_yi_dynasty_decision  = {

		priority = 10

		icon = GFX_decision_generic_monarchy

		ai_will_do = {
			base = 10
		}
	
		allowed = {  
			original_tag = JAP 
		}

		visible = { 
			has_completed_focus = JAP_sea_greater_east_asian_co_properity_sphere
			has_subject = KOR
			KOR = {
				NOT = {
					has_government = fascism
				}
			}
		}
	
		available = {
			
		}

		#days_remove = 70

		#days_re_enable = 180

		cost = 25

		cancel_trigger = {
		}

        cancel_effect = {
        }

		modifier = {
		}

		complete_effect = { 

			KOR = {
				country_event = {
					id = SEA_japan_popup_events.35
					hours = 6
				}	
			}
			custom_effect_tooltip = if_they_accept_tt
			effect_tooltip = {
				KOR = {
					set_politics = {
						ruling_party = fascism
						elections_allowed = no
					}	
					add_popularity = {
						ideology = fascism
						popularity = 0.3
					}	
					add_political_power = 100
				}
			}

		}

		fire_only_once = yes

		remove_effect = {

		}

	}

}

# PROPAGANDA EFFORTS
propaganda_efforts = {

	war_propaganda_manga_industry = { 

		icon = generic_prepare_civil_war

		allowed = {
			original_tag = JAP
		}

		visible = {
			has_war = yes
			NOT = {
				has_government = communism
			}
		}

		available = {
			has_war_support < 0.8
			any_enemy_country = {
				is_literally_china = yes
			}
		}

		fire_only_once = yes

		days_remove = 28

		cost = 75

		complete_effect = {
			
		}

		remove_effect = {
			add_war_support = 0.05
			add_manpower = 5000
		}

		ai_will_do = {
			base = 0
			modifier = {
				add = 201
				has_war_support < 0.7
			}
		}
	}
	
	war_propaganda_film_industry_2 = { 

		icon = generic_prepare_civil_war

		allowed = {
			original_tag = JAP
		}

		visible = {
			original_tag = JAP
			has_country_flag = has_taken_the_war_propaganda_film_industry_decision
			has_completed_focus = JAP_fund_propaganda_films
		}

		available = { 
			has_war_with_non_exiled_country = yes
			OR = {
				is_major = yes
				any_allied_country = {
					is_major = yes
				}
			}
			IF = {
				limit = {
					NOT = { has_government = fascism }
				}
				threat > 0.5
			}
			ELSE = {
				threat > 0.30
			}
		}

		fire_only_once = yes

		cost = 100 

		complete_effect = {
			effect_tooltip = {
				add_war_support = 0.10
			}
			hidden_effect = {
				country_event = political.33
			}
		}

		ai_will_do = {
			base = 0
			modifier = {
				add = 201
				has_war_support < 0.6
			}
		}
	}

}

# State Shinto
JAP_state_shintoism_decisions = {
	
	# Incorporate Imperial Way Buddhism
	JAP_incorporate_imperial_way_buddhism_decision  = {

		priority = 15

		icon = GFX_decision_hol_exchange_intelligence_data

		ai_will_do = {
			base = 25
		}
	
		allowed = {  
			original_tag = JAP 
		}

		visible = { 
			OR = {
				has_completed_focus = JAP_a_new_take_on_state_shintoism
				has_completed_focus = JAP_the_spirit_of_the_imperial_nation
				has_completed_focus = JAP_enact_religious_organizations_law
			}
			OR = {
				has_government = neutrality
				has_government = fascism
			}
		}
	
		available = {
		}

		#days_remove = 70

		#days_re_enable = 180

		cost = 50

		cancel_trigger = {
		}

        cancel_effect = {
        }

		modifier = {
		}

		complete_effect = { 

			JAP_add_or_modify_state_shintoism = yes

			add_to_variable = { JAP_state_shinotism_pocket_penalty = -0.05 tooltip = pocket_penalty_tt }
			add_to_variable = { JAP_state_shinotism_war_support_factor = 0.05 tooltip = war_support_factor_tt }

		}

		fire_only_once = yes

		remove_effect = {

		}

	}

	# One People United under Shinto
	JAP_one_people_united_under_shinto_decision  = {

		priority = 14

		icon = GFX_decision_generic_civil_support

		ai_will_do = {
			base = 2
		}
	
		allowed = {  
			original_tag = JAP 
		}

		visible = { 
			OR = {
				has_completed_focus = JAP_a_new_take_on_state_shintoism
				has_completed_focus = JAP_the_spirit_of_the_imperial_nation
				has_completed_focus = JAP_enact_religious_organizations_law
			}
			#OR = {
			#	has_government = neutrality
			#	has_government = fascism
			#}
		}
	
		available = {
		}

		#days_remove = 70

		#days_re_enable = 180

		cost = 50

		cancel_trigger = {
		}

        cancel_effect = {
        }

		modifier = {
		}

		complete_effect = { 

			JAP_add_or_modify_state_shintoism = yes

			add_to_variable = { JAP_state_shinotism_stability_factor = 0.1 tooltip = stability_factor_tt }
			add_to_variable = { JAP_state_shinotism_war_support_factor = -0.1 tooltip = war_support_factor_tt }

		}

		fire_only_once = yes

		remove_effect = {

		}

	}

	# Relentless Divine Nationalism
	JAP_relentless_divine_nationalism_decision  = {

		priority = 13

		icon = GFX_decision_eng_blackshirt_speech

		ai_will_do = {
			base = 3
		}
	
		allowed = {  
			original_tag = JAP 
		}

		visible = { 
			OR = {
				has_completed_focus = JAP_a_new_take_on_state_shintoism
				has_completed_focus = JAP_the_spirit_of_the_imperial_nation
				has_completed_focus = JAP_enact_religious_organizations_law
			}
			OR = {
				has_government = neutrality
				has_government = fascism
			}
		}
	
		available = {
		}

		#days_remove = 70

		#days_re_enable = 180

		cost = 50

		cancel_trigger = {
		}

        cancel_effect = {
        }

		modifier = {
		}

		complete_effect = { 

			JAP_add_or_modify_state_shintoism = yes

			add_to_variable = { JAP_state_shinotism_justify_war_goal_time = -0.2 tooltip = justify_war_goal_time_tt }
			add_to_variable = { JAP_state_shinotism_war_support_factor = 0.05 tooltip = war_support_factor_tt }

		}

		fire_only_once = yes

		remove_effect = {

		}

	}

	# State Shinto in Education
	JAP_state_shinto_in_education_decision  = {

		priority = 12

		icon = GFX_decision_SOV_academy_of_sciences

		ai_will_do = {
			base = 10
		}
	
		allowed = {  
			original_tag = JAP 
		}

		visible = { 
			OR = {
				has_completed_focus = JAP_a_new_take_on_state_shintoism
				has_completed_focus = JAP_the_spirit_of_the_imperial_nation
				has_completed_focus = JAP_enact_religious_organizations_law
			}
			#OR = {
			#	has_government = neutrality
			#	has_government = fascism
			#}
		}
	
		available = {
		}

		#days_remove = 70

		#days_re_enable = 180

		cost = 75

		cancel_trigger = {
		}

        cancel_effect = {
        }

		modifier = {
		}

		complete_effect = { 

			JAP_add_or_modify_state_shintoism = yes

			add_to_variable = { JAP_state_shinotism_research_speed_factor = 0.05 tooltip = research_speed_factor_tt }

		}

		fire_only_once = yes

		remove_effect = {

		}

	}

}

# Economic Policy 
economy_decisions = { 

	# Open State-run Factories in X
	JAP_open_factory_in_state_decision = {
		icon = GFX_decision_generic_factory
	
		allowed = {
			original_tag = JAP
			has_dlc = "No Compromise, No Surrender"
		}
		
		visible = {
			OR = {
				has_completed_focus = JAP_give_it_your_all_for_the_emperor
				has_completed_focus = JAP_ganbarou
			}
		}
		
		available = {
		}

		state_target = yes

		target_array = ROOT.core_states
	    
	    target_trigger = {
	        FROM = {
	        	JAP_is_home_islands_state = yes
	        	is_fully_controlled_by = ROOT
	        	infrastructure > 3 # It needs to be 4 or higher 
	        	free_building_slots = {
	        		building = industrial_complex
	        		size > 1
	        		include_locked = yes
	        	}	
	        }
	    }
	    on_map_mode = map_and_decisions_view 

	    cost = 50 	

		fire_only_once = yes # Can only be done once per state

		days_remove = 70

		modifier = {
			consumer_goods_factor = 0.05
		}

		complete_effect = {
		}

		remove_effect = {
			FROM = {
				add_extra_state_shared_building_slots = 1
				add_building_construction = {
					type = industrial_complex
					level = 1
					instant_build = yes
				}	
			}
		}

		cancel_trigger = {
			FROM = {
				NOT = { is_fully_controlled_by = ROOT }
			}
		}

		cancel_effect = {
		}

	}

	# Invest in the Urbanization of §Y[FROM.GetName]§!
	JAP_improve_the_category_of_state_decision = {
		icon = GFX_decision_generic_construction
	
		allowed = {
			original_tag = JAP
			has_dlc = "No Compromise, No Surrender"
		}
		
		visible = {
			has_completed_focus = JAP_further_rural_investments
		}
		
		available = {
		}

		state_target = any_owned_state
	    
	    target_trigger = {
	        FROM = {
	        	is_core_of = ROOT
	        	is_owned_and_controlled_by = ROOT
	        	infrastructure > 3 # It needs to be 4 or higher 
	        	has_state_flag = JAP_can_upgrade_this_states_level_flag
	        }
	    }
	    on_map_mode = map_and_decisions_view 

	    cost = 35	

		fire_only_once = yes # Can only be done once per state

		days_remove = 14

		modifier = {
			consumer_goods_factor = 0.05
		}

		complete_effect = {
		}

		remove_effect = {
			FROM = {
				ETH_upgrade_state_category = yes
			}
		}

		cancel_trigger = {
			FROM = {
				NOT = { is_controlled_by = ROOT }
			}
		}

		cancel_effect = {
		}

	}

	# Redistribute Wealth and Collectivize Farms
	JAP_redistribute_wealth_and_collectivize_farms_decision = {
		icon = GFX_decision_generic_welfare
	
		allowed = {
			original_tag = JAP
			has_dlc = "No Compromise, No Surrender"
		}
		
		visible = {
			has_completed_focus = JAP_fukumotoism
			check_variable = { JAP_economic_redistribtuion_level < JAP_economic_redistribtuion_max }
		}
		
		available = {
			check_variable = { JAP_economic_redistribtuion_level < JAP_economic_redistribtuion_max }
			custom_trigger_tooltip = {
				tooltip = JAP_redistribute_wealth_tt
				check_variable = { JAP_economic_redistribtuion_level < JAP_economic_redistribtuion_max }
			}
		}

	    cost = 75	

		fire_only_once = no

		days_remove = 35 

		modifier = {
			consumer_goods_factor = 0.1
		}

		complete_effect = {
		}

		remove_effect = {

			JAP_add_or_modify_early_industrialization = yes
			add_to_variable = { JAP_industry_consumer_goods_factor = -0.025 tooltip = consumer_goods_factor_tt }
			custom_effect_tooltip = generic_skip_one_line_tt
			random_owned_controlled_state = {
				limit = {
					is_core_of = ROOT
					free_building_slots = {
						building = industrial_complex
						size > 1
						include_locked = yes
					}	
				}
				add_extra_state_shared_building_slots = 2
				add_building_construction = {
					type = industrial_complex
					level = 2
					instant_build = yes
				}	
			}

			hidden_effect = {
				add_to_variable = { JAP_economic_redistribtuion_level = 1 }
				clamp_variable = {
					var = JAP_economic_redistribtuion_level
					min = JAP_economic_redistribtuion_min
					max = JAP_economic_redistribtuion_max
				}
			}

		}

		cancel_trigger = {
			
		}

		cancel_effect = {
		}

	}


	### MISSIONS ###

	# Implementing Kōzō Uno's Economic Reforms
	JAP_implementing_unos_economic_reforms_mission = {

		priority = 250

		icon = GFX_decision_generic_consumer_goods

		available = {
			hidden_trigger = { always = no }
		}

		days_mission_timeout = 360

		fire_only_once = no

		activation = {
			always = no
		}

		visible = {
			tag = JAP
			has_government = communism
		}

		cancel_if_not_visible = yes

		is_good = yes

		timeout_effect = {
			
			JAP_add_or_modify_early_industrialization = yes

			add_to_variable = { JAP_industry_consumer_goods_factor = -0.025 tooltip = consumer_goods_factor_tt }

			hidden_effect = { activate_mission = JAP_implementing_unos_economic_reforms_mission }
			
		}
	}




}

# The People's Republic
JAP_the_peoples_state_decisions = {
	
	# Secure Control of STATE 
	JAP_secure_control_from_army_decision = {
		icon = GFX_decision_generic_civil_support
	
		allowed = {
		}
		
		visible = {
			has_completed_focus = JAP_okadas_military_purge_speech
			NOT = {
				has_completed_focus = JAP_revoke_the_peace_preservation_law
			}
			any_owned_state = {
				has_dynamic_modifier = {
					modifier = JAP_state_under_army_control
				}	
			}
		}

		ai_will_do = {
			base = 75
			modifier = {
				factor = 0
				NOT = {
					FROM = {
						any_neighbor_state = {
							has_dynamic_modifier = {
								modifier = JAP_state_under_rebel_control
							}	
						}
					}
				}
			}
		}
		
		available = {
		}

		state_target = any_owned_state
	    
	    target_trigger = {
	        FROM = {
	        	has_dynamic_modifier = {
	        		modifier = JAP_state_under_army_control
	        	}	
	        	NOT = {
	        		state = 531 # Osaka is secured by the army faster than you could, so not worth potentially wasting pp on 
	        	}
	        }
	    }
	    on_map_mode = map_only

	    cost = JAP_democratic_state_flipping_cost_cost	

		fire_only_once = yes # Can only be done once per state

		days_remove = 42 # Should be quite slow, you shouldn't have more than half of the home islands states by the cw unless doign focuses that give some for free etc 

		modifier = {
			
		}

		cancel_trigger = {
			has_civil_war = yes
		}

		complete_effect = {
			custom_effect_tooltip = JAP_democratic_state_flipping_cost_cost_increase_tt
			add_to_variable = {
				var = JAP_democratic_state_flipping_cost_cost
				value = 15
			}	
		}

		remove_effect = {
			FROM = {
				remove_dynamic_modifier = {
					modifier = JAP_state_under_army_control
				}	
				add_dynamic_modifier = {
					modifier = JAP_state_under_rebel_control
				}	
			}
		}

		cancel_trigger = {
			FROM = {
				NOT = { 
					is_controlled_by = ROOT 
					has_dynamic_modifier = {
						modifier = JAP_state_under_army_control
					}
				}
			}
		}

		cancel_effect = {
		}

	}

	# Sway General Loyalty
	JAP_sway_general_loyalty_decision = {

		icon = GFX_decision_generic_army_support

		allowed = {
			original_tag = JAP
		}

		available = {
		}

		cost = 25

		fire_only_once = no

		ai_will_do = {
			base = 100
		}

		days_remove = 21

		modifier = {
			
		}

		visible = {
			has_completed_focus = JAP_bribe_generals
			NOT = {
				has_completed_focus = JAP_revoke_the_peace_preservation_law
			}
		}

		cancel_trigger = {
			has_civil_war = yes
		}

		complete_effect = {
			
		}

		remove_effect = {
			random_army_leader = {
				limit = {
					has_trait = JAP_IJA_loyalist
					NOT = { 
						has_trait = JAP_government_supporter 
						has_trait = JAP_communist_sympathizer 
					}
					NOT = { has_character_flag = JAP_do_not_align_me_flag }
				}
				add_trait = {
					trait = JAP_government_supporter
				}	
				remove_trait = {
					trait = JAP_IJA_loyalist
				}
				set_unit_leader_flag = JAP_swayed_leader_loyalty_flag
			}
			
		}

	}

	# Sway Admiral Loyalty
	JAP_sway_admiral_loyalty_decision = {

		icon = GFX_decision_SWE_set_navy_budget

		allowed = {
			original_tag = JAP
		}

		available = {
		}

		cost = 25

		fire_only_once = no

		ai_will_do = {
			base = 100
		}

		days_remove = 21

		modifier = {
			
		}

		visible = {
			has_completed_focus = JAP_bribe_generals
			NOT = {
				has_completed_focus = JAP_revoke_the_peace_preservation_law
			}
		}

		cancel_trigger = {
			has_civil_war = yes
		}

		complete_effect = {
			
		}

		remove_effect = {
			random_navy_leader = {
				limit = {
					has_trait = JAP_IJA_loyalist
					NOT = { 
						has_trait = JAP_government_supporter 
						has_trait = JAP_communist_sympathizer 
					}
					NOT = { has_character_flag = JAP_do_not_align_me_flag }
				}
				add_trait = {
					trait = JAP_government_supporter
				}	
				remove_trait = {
					trait = JAP_IJA_loyalist
				}
				set_unit_leader_flag = JAP_swayed_leader_loyalty_flag
			}
			
		}

	}

	# Hold a Speech in the Imperial Diet
	JAP_hold_speech_in_the_imperial_diet_decision = {

		icon = GFX_decision_generic_speech

		allowed = {
			original_tag = JAP
		}

		available = {
		}

		cost = 50

		fire_only_once = no

		ai_will_do = {
			base = 100
			modifier = {
				add = -100
				has_completed_focus = JAP_secretly_rebuild_the_party
			}
		}

		days_remove = 70

		modifier = {
			democratic_drift = 0.1
		}

		visible = {
			has_completed_focus = JAP_build_an_anti_army_coalition
			NOT = {
				has_completed_focus = JAP_revoke_the_peace_preservation_law
			}
		}

		cancel_trigger = {
			has_civil_war = yes
		}

		complete_effect = {
			
		}

		remove_effect = {
			

			
		}

	}

	# Publically Distance from the Soviet Union
	JAP_publically_distance_from_sov_decision = {

		icon = GFX_decision_generic_political_rally

		allowed = {
			original_tag = JAP
		}

		available = {
		}

		cost = 25

		fire_only_once = yes

		ai_will_do = {
			base = 200
		}

		days_remove = 35

		modifier = {
			
		}

		visible = {
			has_completed_focus = JAP_secretly_rebuild_the_party
			NOT = {
				has_completed_focus = JAP_revoke_the_peace_preservation_law
			}
		}

		cancel_trigger = {
			has_civil_war = yes
		}

		complete_effect = {
			
		}

		remove_effect = {
			
			add_popularity = {
				ideology = communism
				popularity = 0.05
			}	

			custom_effect_tooltip = JAP_publically_distance_from_sov_decision_tt

			hidden_effect = {
				set_country_flag = JAP_jcp_distanced_themselves_from_the_soviets_flag
			}
			
		}

	}

	# Communist Infiltration of STATE 
	JAP_communist_infiltration_of_state_decision_decision = {
		icon = GFX_decisions_generic_infiltration
	
		allowed = {
		}
		
		visible = {
			has_completed_focus = JAP_secretly_rebuild_the_party
			NOT = {
				has_completed_focus = JAP_revoke_the_peace_preservation_law
			}
			any_owned_state = {
				has_dynamic_modifier = {
					modifier = JAP_state_under_rebel_control
				}	
				NOT = {
					has_dynamic_modifier = {
						modifier = JAP_state_infiltrated_by_the_jcp
					}	
				}
			}
		}

		ai_will_do = {
			base = 85
		}
		
		available = {
		}

		state_target = any_owned_state
	    
	    target_trigger = {
	        FROM = {
	        	has_dynamic_modifier = {
	        		modifier = JAP_state_under_rebel_control
	        	}	
	        	NOT = {
	        		has_dynamic_modifier = {
	        			modifier = JAP_state_infiltrated_by_the_jcp
	        		}	
	        	}
	        	NOT = {
	        		state = 282 # The communists can't infiltrate Tokyo
	        	}
	        }
	    }
	    on_map_mode = map_only

	    cost = JAP_communist_state_infiltrating_cost_cost	

		fire_only_once = yes # Can only be done once per state

		days_remove = 35

		modifier = {
			
		}

		cancel_trigger = {
			has_civil_war = yes
		}

		complete_effect = {
			custom_effect_tooltip = JAP_communist_state_infiltrating_cost_cost_increase_tt
			add_to_variable = {
				var = JAP_communist_state_infiltrating_cost_cost
				value = 10
			}	
		}

		remove_effect = {
			FROM = {
				add_dynamic_modifier = {
					modifier = JAP_state_infiltrated_by_the_jcp
				}	
			}
		}

		cancel_trigger = {
			FROM = {
				NOT = { 
					is_controlled_by = ROOT 
					has_dynamic_modifier = {
						modifier = JAP_state_under_army_control
					}
				}
			}
		}

		cancel_effect = {
		}

	}

	# Distribute Socialist Pamphlets
	JAP_spread_socialist_pamphlets_decision = {

		icon = GFX_decision_generic_political_discourse

		allowed = {
			original_tag = JAP
		}

		available = {
		}

		cost = 50

		fire_only_once = no

		ai_will_do = {
			base = 100
		}

		days_remove = 70

		modifier = {
			communism_drift = 0.08
		}

		visible = {
			has_completed_focus = JAP_anti_militarist_speeches_in_the_diet
			has_country_flag = JAP_jcp_distanced_themselves_from_the_soviets_flag
			NOT = {
				has_completed_focus = JAP_revoke_the_peace_preservation_law
			}
		}

		cancel_trigger = {
			has_civil_war = yes
		}

		complete_effect = {
			
		}

		remove_effect = {
			
			
			
		}

	}

	# Spread Socialist Propaganda in University Campuses
	JAP_spread_socialist_propaganda_in_campuses_decision = {

		icon = GFX_decision_eng_propaganda_campaigns

		allowed = {
			original_tag = JAP
		}

		available = {
		}

		cost = 50

		fire_only_once = yes

		ai_will_do = {
			base = 250
		}

		days_remove = 35

		modifier = {
			
		}

		visible = {
			has_completed_focus = JAP_organize_the_student_movements
			has_country_flag = JAP_jcp_distanced_themselves_from_the_soviets_flag
			NOT = {
				has_completed_focus = JAP_revoke_the_peace_preservation_law
			}
		}

		cancel_trigger = {
			has_civil_war = yes
		}

		complete_effect = {
			
		}

		remove_effect = {
			
			JAP_add_or_modify_communist_party_modifier = yes

			add_to_variable = { JAP_communist_party_communism_drift = 0.03 tooltip = communism_drift_tt }
			add_to_variable = { JAP_communist_party_research_speed_factor = 0.05 tooltip = research_speed_factor_tt }
			
		}

	}

	# Establish Guerilla Units in STATE 
	JAP_establish_guerilla_units_in_state_decision = {
		icon = GFX_decision_generic_military
	
		allowed = {
		}
		
		visible = {
			has_completed_focus = JAP_mountain_village_operation_units
			NOT = {
				has_completed_focus = JAP_revoke_the_peace_preservation_law
			}
		}

		ai_will_do = {
			base = 100
		}
		
		available = {
		}

		state_target = any_owned_state
	    
	    target_trigger = {
	        FROM = {
	        	JAP_is_home_islands_state = yes
	        	NOT = {
	        		state = 282 # The communists can't infiltrate Tokyo
	        	}
	        }
	    }
	    on_map_mode = map_only

	    custom_cost_trigger = {
	    	command_power > 39
	    }
	    custom_cost_text = decision_cost_CP_40

		fire_only_once = yes # Can only be done once per state

		days_remove = 35

		modifier = {
			
		}

		cancel_trigger = {
			has_civil_war = yes
		}

		complete_effect = {
			hidden_effect = {
				add_command_power = -40
			}
		}

		remove_effect = {
			custom_effect_tooltip = JAP_establish_guerilla_units_in_state_decision_tt
			FROM = {
				set_state_flag = JAP_mountain_villages_operation_units_active_here
			}
		}

		cancel_trigger = {
			FROM = {
				NOT = { 
					is_controlled_by = ROOT 
				}
			}
		}

		cancel_effect = {
		}

	}

	# Move the Capital Back to Tokyo
	JAP_move_the_capital_back_to_tokyo_decision = {

		icon = GFX_decision_eng_propaganda_campaigns

		allowed = {
			original_tag = JAP
		}

		cost = 15

		fire_only_once = yes

		ai_will_do = {
			base = 500
		}

		#days_remove = 35

		modifier = {
			
		}

		visible = {
			282 = {
				is_capital = no
			}
			has_completed_focus = JAP_revoke_the_peace_preservation_law
		}

		available = {
			282 = {
				is_fully_controlled_by = ROOT
			}
			has_civil_war = no
		}

		cancel_trigger = {
		}

		complete_effect = {
			set_capital = {
				state = 282
				remember_old_capital = no
			}
			add_stability = 0.05
		}

		remove_effect = {
			
		}

	}

	# Raid an Infantry Weapons Depot
	JAP_raid_an_infantry_weapons_depot_decision = {
		icon = GFX_decision_generic_prepare_civil_war
	
		allowed = {
		}
		
		visible = {
			has_completed_focus = JAP_organize_underground_resistance
			NOT = {
				has_completed_focus = JAP_revoke_the_peace_preservation_law
			}
		}

		ai_will_do = {
			base = 100
		}
		
		available = {
		}

		#state_target = any_owned_state
	    
	    #target_trigger = {
	    #}
	    #on_map_mode = map_only

	    ai_hint_pp_cost = 15
	    custom_cost_trigger = {
	    	command_power > 14
	    	has_political_power > 14
	    }
	    custom_cost_text = decision_cost_CP_15_pp_15

		fire_only_once = yes # Can only be done once per state

		days_remove = 35

		modifier = {
			
		}

		cancel_trigger = {
			has_civil_war = yes
		}

		complete_effect = {
			hidden_effect = {
				add_command_power = -15
				add_political_power = -15
			}
		}

		remove_effect = {
			custom_effect_tooltip = JAP_raid_an_infantry_weapons_depot_decision_tt
			hidden_effect = {
				set_country_flag = JAP_communists_siezed_infantry_weapons_flag
			}
		}

		cancel_trigger = {
		}

		cancel_effect = {
		}

	}

	# Raid an Artillery Depot
	JAP_raid_an_artillery_depot_decision = {
		icon = GFX_decision_generic_industry
	
		allowed = {
		}
		
		visible = {
			has_completed_focus = JAP_organize_underground_resistance
			NOT = {
				has_completed_focus = JAP_revoke_the_peace_preservation_law
			}
		}

		ai_will_do = {
			base = 100
		}
		
		available = {
		}

		#state_target = any_owned_state
	    
	    #target_trigger = {
	    #}
	    #on_map_mode = map_only

	    ai_hint_pp_cost = 15
	    custom_cost_trigger = {
	    	command_power > 14
	    	has_political_power > 14
	    }
	    custom_cost_text = decision_cost_CP_15_pp_15

		fire_only_once = yes # Can only be done once per state

		days_remove = 35

		modifier = {
			
		}

		cancel_trigger = {
			has_civil_war = yes
		}

		complete_effect = {
			hidden_effect = {
				add_command_power = -15
				add_political_power = -15
			}
		}

		remove_effect = {
			custom_effect_tooltip = JAP_raid_an_artillery_depot_decision_tt
			hidden_effect = {
				set_country_flag = JAP_communists_siezed_artillery_flag
			}
		}

		cancel_trigger = {
		}

		cancel_effect = {
		}

	}

	# Raid a Truck Depot
	JAP_raid_a_truck_depot_decision = {
		icon = GFX_decision_generic_trucks
	
		allowed = {
		}
		
		visible = {
			has_completed_focus = JAP_organize_underground_resistance
			NOT = {
				has_completed_focus = JAP_revoke_the_peace_preservation_law
			}
		}

		ai_will_do = {
			base = 100
		}
		
		available = {
		}

		#state_target = any_owned_state
	    
	    #target_trigger = {
	    #}
	    #on_map_mode = map_only

	    ai_hint_pp_cost = 15
	    custom_cost_trigger = {
	    	command_power > 14
	    	has_political_power > 14
	    }
	    custom_cost_text = decision_cost_CP_15_pp_15

		fire_only_once = yes # Can only be done once per state

		days_remove = 35

		modifier = {
			
		}

		cancel_trigger = {
			has_civil_war = yes
		}

		complete_effect = {
			hidden_effect = {
				add_command_power = -15
				add_political_power = -15
			}
		}

		remove_effect = {
			custom_effect_tooltip = JAP_raid_a_truck_depot_decision_tt
			hidden_effect = {
				set_country_flag = JAP_communists_siezed_trucks_flag
			}
		}

		cancel_trigger = {
		}

		cancel_effect = {
		}

	}

	# Launch an Offensive in [FROM.GetNameDef]
	JAP_launch_an_offensive_in_core_state_decision  = {

		priority = 10

		icon = GFX_decision_border_war

		highlight_states = {
			highlight_states_trigger = {
				state = FROM
			}
		}

		allowed = {  
			original_tag = JAP 
		}

		state_target = yes

		target_array = ROOT.core_states

	    target_trigger = {
	        FROM = {
	        	controller = {
	        		original_tag = JAP
	        		has_war_with = ROOT
	        	}
	        	any_neighbor_state = {
	        		is_controlled_by_ROOT_or_ally = yes
	        	}
	        }
	    }
	    on_map_mode = map_only

		ai_will_do = {
			base = 50
		}

		visible = { 
			has_completed_focus = JAP_revoke_the_peace_preservation_law
			any_enemy_country = {
				original_tag = JAP
			}
		}
	
		available = {
			NOT = {
				has_country_flag = JAP_preparing_an_offensive_in_progress
			}
		}

		custom_cost_trigger = {
			command_power > 24.9
		}
		custom_cost_text = BRA_decision_cost_cangaceiro
		
		fire_only_once = yes

		days_remove = 7

		complete_effect = {
			hidden_effect = {
				add_command_power = -25
				set_country_flag = { flag = JAP_preparing_an_offensive_in_progress value = 1 days = 8 }
			}
		}

		cancel_trigger = {
			FROM = {
				OR = {
					is_controlled_by = ROOT
					controller = {
						NOT = {
							original_tag = JAP
							has_war_with = ROOT
						}
					}
					NOT = {
						any_neighbor_state = {
							is_controlled_by_ROOT_or_ally = yes
						}
					}
				}
			}
		}

        cancel_effect = {
        	add_command_power = 5
        	hidden_effect = {
        		clr_country_flag = JAP_preparing_an_offensive_in_progress
        	}
        }

		modifier = {
		}

		remove_effect = {

			FROM = {
				add_dynamic_modifier = {
					modifier = JAP_chinese_offensive_military_offensive
					days = 70
					scope = JAP
				}
			}

			hidden_effect = {
				clr_country_flag = JAP_preparing_an_offensive_in_progress
			}

		}

	}

	# Sabotage Behind Enemy Lines
	JAP_organize_the_fifth_column_decision = {
		icon = generic_assassination
		state_target = yes

		target_array = ROOT.core_states

		priority = 5

		target_root_trigger = {
			has_completed_focus = JAP_organize_the_fifth_column
		}

		target_trigger = {
			FROM = {
				is_core_of = ROOT
			}
		}

		available = {
			ROOT = { NOT = { has_country_flag = JAP_organize_the_fifth_column_flag } }
		}
		ai_will_do = {
			base = 100 # This is generally a good thing to do
			modifier = {
				add = FROM.state_strategic_value # Prioritize important states
				always = yes
			}
			modifier = {
				factor = 2
				always = yes
			}
		}

		visible = {
			FROM = {
				OR = {
					controller = {
						original_tag = JAP
						NOT = {
							tag = ROOT
						}
					}
					AND = {
						is_controlled_by = ROOT
						NOT = { is_fully_controlled_by = ROOT }
					}
				}
				owner = {
					original_tag = JAP
					NOT = {
						tag = ROOT
					}
				}
				any_neighbor_state = { is_controlled_by = ROOT }
			}
			has_civil_war = yes
		}

		on_map_mode = map_only
		fire_only_once = yes

		custom_cost_trigger = {
			command_power > 14
		}
		custom_cost_text = SOV_sabotage_behind_enemy_lines_cost
		days_remove = 14

		complete_effect = {
			hidden_effect = {
				add_command_power = -15
				set_country_flag = {
				    flag = JAP_organize_the_fifth_column_flag
				    days = 15
				    value = 1
				}
			}
		}
		remove_effect = {
			damage_units = {
				state = FROM
				limit = { 
					original_tag = JAP
					NOT = {
						tag = ROOT
					} 
				}
				org_damage = 0.25
				str_damage = 0.1
				ratio = yes
				army = yes
				navy = no
			}
			custom_effect_tooltip = JAP_organize_the_fifth_column_decision_tt
			clr_country_flag = JAP_organize_the_fifth_column_flag
		}

	}

	### MISSIONS ###

	# Army Securing Control over Osaka
	JAP_securing_control_over_osaka_mission = {

		priority = 100

		icon = GFX_decision_gre_faction_management

		available = {
			hidden_trigger = { always = no }
		}

		days_mission_timeout = 35

		fire_only_once = yes

		activation = {
			always = no
		}

		visible = {
			tag = JAP
			NOT = {
				has_completed_focus = JAP_revoke_the_peace_preservation_law
			}
		}

		cancel_if_not_visible = yes

		is_good = no

		timeout_effect = {
			
			add_popularity = {
				ideology = fascism
				popularity = 0.03
			}	

			custom_effect_tooltip = JAP_securing_control_over_osaka_mission_tt

			hidden_effect = { activate_mission = JAP_army_politically_purging_disloyal_young_officers_mission }
			
		}
	}

	# Army Politically Purging Disloyal Young Officers
	JAP_army_politically_purging_disloyal_young_officers_mission = {

		priority = 100

		icon = GFX_decision_SWE_set_army_budget

		available = {
			hidden_trigger = { always = no }
		}

		days_mission_timeout = 84

		fire_only_once = yes

		activation = {
			always = no
		}

		visible = {
			tag = JAP
			NOT = {
				has_completed_focus = JAP_revoke_the_peace_preservation_law
			}
		}

		cancel_if_not_visible = yes

		is_good = no

		timeout_effect = {
			
			custom_effect_tooltip = JAP_army_politically_purging_disloyal_young_officers_mission_2_tt
			hidden_effect = {
				every_army_leader = {
					limit = {
						has_trait = JAP_IJA_loyalist
						NOT = {
							is_character = JAP_tadaichi_wakamatsu
						}
						NOT = { has_character_flag = JAP_do_not_align_me_flag }
					}
					random_select_amount = 1
					set_character_flag = JAP_do_not_align_me_flag
				}
			}

			custom_effect_tooltip = generic_skip_one_line_tt

			custom_effect_tooltip = JAP_army_politically_purging_disloyal_young_officers_mission_tt
			hidden_effect = {
				set_country_flag = JAP_IJA_secured_first_bit_of_army_support_flag
			}

			hidden_effect = { activate_mission = JAP_army_recruiting_more_conscripts_mission }

		}
	}

	# Army Recruiting More Conscripts
	JAP_army_recruiting_more_conscripts_mission = {

		priority = 100

		icon = GFX_decision_generic_military

		available = {
			hidden_trigger = { always = no }
		}

		days_mission_timeout = 84

		fire_only_once = yes

		activation = {
			always = no
		}

		visible = {
			tag = JAP
			NOT = {
				has_completed_focus = JAP_revoke_the_peace_preservation_law
			}
		}

		cancel_if_not_visible = yes

		is_good = no

		timeout_effect = {

			custom_effect_tooltip = JAP_army_recruiting_more_conscripts_mission_tt

			hidden_effect = {
				set_country_flag = JAP_IJA_recruited_more_conscripts_flag
			}

			hidden_effect = { activate_mission = JAP_army_broadcasting_militarist_propaganda_mission }

		}
	}

	# Army Broadcasting Militarist Propaganda
	JAP_army_broadcasting_militarist_propaganda_mission = {

		priority = 100

		icon = GFX_decision_hol_radio_oranje

		available = {
			hidden_trigger = { always = no }
		}

		days_mission_timeout = 84

		fire_only_once = yes

		activation = {
			always = no
		}

		visible = {
			tag = JAP
			NOT = {
				has_completed_focus = JAP_revoke_the_peace_preservation_law
			}
		}

		cancel_if_not_visible = yes

		is_good = no

		timeout_effect = {

			add_stability = -0.05

			custom_effect_tooltip = generic_skip_one_line_tt

			add_popularity = {
				ideology = democratic
				popularity = -0.05
			}	

			#hidden_effect = {
			#	set_country_flag = JAP_IJA_recruited_more_conscripts_flag
			#}

			hidden_effect = { activate_mission = JAP_army_smuggling_kwantung_army_units_to_the_home_islands_mission }

		}
	}

	# Army Smuggling Kwantung Army Units to the Home Islands
	JAP_army_smuggling_kwantung_army_units_to_the_home_islands_mission = {

		priority = 100

		icon = GFX_decision_infiltrate_state

		available = {
			hidden_trigger = { always = no }
		}

		days_mission_timeout = 84

		fire_only_once = yes

		activation = {
			always = no
		}

		visible = {
			tag = JAP
			NOT = {
				has_completed_focus = JAP_revoke_the_peace_preservation_law
			}
		}

		cancel_if_not_visible = yes

		is_good = no

		timeout_effect = {

			custom_effect_tooltip = JAP_army_smuggling_kwantung_army_units_to_the_home_islands_mission_tt

			hidden_effect = {
				set_country_flag = JAP_IJA_recruited_kwantung_army_units_for_cw_flag
			}

			hidden_effect = { activate_mission = JAP_tokko_arresting_anti_army_disidents_mission }

		}
	}

	# Army Smuggling Kwantung Army Units to the Home Islands
	JAP_tokko_arresting_anti_army_disidents_mission = {

		priority = 100

		icon = GFX_decision_generic_arrest

		available = {
			hidden_trigger = { always = no }
		}

		days_mission_timeout = 84

		fire_only_once = yes

		activation = {
			always = no
		}

		visible = {
			tag = JAP
			NOT = {
				has_completed_focus = JAP_revoke_the_peace_preservation_law
			}
		}

		cancel_if_not_visible = yes

		is_good = no

		timeout_effect = {

			custom_effect_tooltip = JAP_tokko_arresting_anti_army_disidents_mission_tt
			show_ideas_tooltip = JAP_kozo_sasaki
			show_ideas_tooltip = JAP_komakichi_matsuoka
			show_ideas_tooltip = JAP_mitsumasa_yonai
			show_ideas_tooltip = JAP_noboru_yamaguchi

			hidden_effect = {
				set_country_flag = JAP_IJA_arrested_advisors_flag
				JAP_kozo_sasaki = {
					set_portraits = {
						civilian = {
							small = GFX_portrait_JAP_kozo_sasaki_imprisoned
						}
					}
				}
				JAP_komakichi_matsuoka = {
					set_portraits = {
						civilian = {
							small = GFX_portrait_JAP_komakichi_matsuoka_imprisoned
						}
					}
				}
				JAP_mitsumasa_yonai = {
					set_portraits = {
						civilian = {
							small = GFX_portrait_JAP_mitsumasa_yonai_civilian_imprisoned
						}
					}
				}
				JAP_noboru_yamaguchi = {
					set_portraits = {
						civilian = {
							small = GFX_portrait_JAP_noboru_yamaguchi_imprisoned
						}
					}
				}
			}

			hidden_effect = { activate_mission = JAP_army_securing_navy_support_mission }

		}
	}

	# Army Securing Navy Support
	JAP_army_securing_navy_support_mission = {

		priority = 100

		icon = GFX_decision_SWE_set_navy_budget

		available = {
			hidden_trigger = { always = no }
		}

		days_mission_timeout = 84

		fire_only_once = yes

		activation = {
			always = no
		}

		visible = {
			tag = JAP
			NOT = {
				has_completed_focus = JAP_revoke_the_peace_preservation_law
			}
		}

		cancel_if_not_visible = yes

		is_good = no

		timeout_effect = {
			
			custom_effect_tooltip = JAP_army_securing_navy_support_mission_tt
			
			hidden_effect = {
				set_country_flag = JAP_IJA_secured_more_navy_support_support_flag
			}

			hidden_effect = { activate_mission = JAP_army_ensuring_loyalty_within_the_regiments_mission }

		}
	}

	# Army Ensuring Loyalty within the Military Regiments
	JAP_army_ensuring_loyalty_within_the_regiments_mission = {

		priority = 100

		icon = GFX_decision_generic_army_support

		available = {
			hidden_trigger = { always = no }
		}

		days_mission_timeout = 84

		fire_only_once = yes

		activation = {
			always = no
		}

		visible = {
			tag = JAP
			NOT = {
				has_completed_focus = JAP_revoke_the_peace_preservation_law
			}
		}

		cancel_if_not_visible = yes

		is_good = no

		timeout_effect = {
			
			custom_effect_tooltip = JAP_army_ensuring_loyalty_within_the_regiments_mission_tt
			
			hidden_effect = {
				set_country_flag = JAP_IJA_secured_more_army_support_support_flag
			}

			hidden_effect = { activate_mission = JAP_army_broadcasting_militarist_propaganda_2_mission }

		}
	}

	# Army Broadcasting Anti-Government Propaganda
	JAP_army_broadcasting_militarist_propaganda_2_mission = {

		priority = 100

		icon = GFX_decision_hol_radio_oranje

		available = {
			hidden_trigger = { always = no }
		}

		days_mission_timeout = 84

		fire_only_once = yes

		activation = {
			always = no
		}

		visible = {
			tag = JAP
			NOT = {
				has_completed_focus = JAP_revoke_the_peace_preservation_law
			}
		}

		cancel_if_not_visible = yes

		is_good = no

		timeout_effect = {

			add_stability = -0.05

			custom_effect_tooltip = generic_skip_one_line_tt

			add_popularity = {
				ideology = democratic
				popularity = -0.05
			}	

			hidden_effect = { activate_mission = JAP_army_securing_army_arsenals_mission }

		}
	}

	# Army Securing Vital Army Arsenals
	JAP_army_securing_army_arsenals_mission = {

		priority = 100

		icon = GFX_decision_generic_industry

		available = {
			hidden_trigger = { always = no }
		}

		days_mission_timeout = 84

		fire_only_once = yes

		activation = {
			always = no
		}

		visible = {
			tag = JAP
			NOT = {
				has_completed_focus = JAP_revoke_the_peace_preservation_law
			}
		}

		cancel_if_not_visible = yes

		is_good = no

		timeout_effect = {

			custom_effect_tooltip = JAP_army_securing_army_arsenals_mission_tt	
			show_ideas_tooltip = JAP_army_arsenals_emptied_idea

			hidden_effect = {
				set_country_flag = JAP_IJA_secured_army_arsenals_flag
			}

			#hidden_effect = { activate_mission = JAP_army_smuggling_kwantung_army_units_to_the_home_islands_mission }

		}
	}


}

# Industrial Investments
JAP_investing_in_foreign_industries_cat = {
	
	JAP_industrial_investment_for_oil_decision = {
		icon = GFX_decision_oil
		priority = 8

		allowed = {
			original_tag = JAP
		}

		visible = {
			has_completed_focus = JAP_invest_in_foreign_industries
		}

		available = {
			NOT = { has_country_flag = JAP_currently_investing_in_foreign_industry_flag } 
		}

		cost = 50

		fire_only_once = yes

		days_remove = 30

		state_target = yes

		target_trigger = {
			FROM = {
				OWNER = {
					OR = {
						controls_state = PREV
						ROOT = {
							has_country_flag = JAP_currently_investing_in_foreign_industry_flag
						}
					}
				}
				OR = {
					state = 1023 # Brunei
					state = 288 # Magwe 
				}
			}
		}

		cancel_trigger = {
			FROM = {
				OWNER = {
					NOT = {
						has_full_control_of_state = PREV
					}
				}
			}
		}

		cancel_effect = {
			clr_country_flag = JAP_currently_investing_in_foreign_industry_flag
		}	

		complete_effect = {
			set_country_flag = JAP_currently_investing_in_foreign_industry_flag
		}

		remove_effect = {
			clr_country_flag = JAP_currently_investing_in_foreign_industry_flag

			set_country_flag = JAP_requests_oil_flag

			FROM.OWNER = {
				country_event = {
					id = SEA_japan_foreign_policy.89
					hours = 6
				}
			}

			custom_effect_tooltip = if_they_accept_tt
			custom_effect_tooltip = JAP_industrial_investment_descision_tt
		}
	}

	JAP_industrial_investment_for_tungsten_decision = {
		icon = GFX_decision_tungsten
		priority = 8

		allowed = {
			original_tag = JAP
		}

		visible = {
			has_completed_focus = JAP_invest_in_foreign_industries
		}

		available = {
			NOT = { has_country_flag = JAP_currently_investing_in_foreign_industry_flag } 
		}

		cost = 50

		fire_only_once = yes

		days_remove = 30

		state_target = yes

		target_trigger = {
			FROM = {
				OWNER = {
					OR = {
						controls_state = PREV
						ROOT = {
							has_country_flag = JAP_currently_investing_in_foreign_industry_flag
						}
					}
				}
				OR = {
					state = 640 # Mandalay 
					state = 671 # Tonkin 
					state = 429 # Bombay 
				}
			}
		}

		cancel_trigger = {
			FROM = {
				OWNER = {
					NOT = {
						has_full_control_of_state = PREV
					}
				}
			}
		}

		cancel_effect = {
			clr_country_flag = JAP_currently_investing_in_foreign_industry_flag
		}

		complete_effect = {
			set_country_flag = JAP_currently_investing_in_foreign_industry_flag
		}

		remove_effect = {
			clr_country_flag = JAP_currently_investing_in_foreign_industry_flag

			set_country_flag = JAP_requests_tungsten_flag

			FROM.OWNER = {
				country_event = {
					id = SEA_japan_foreign_policy.89
					hours = 6
				}
			}

			custom_effect_tooltip = if_they_accept_tt
			custom_effect_tooltip = JAP_industrial_investment_descision_tt
		}
	}

	JAP_industrial_investment_for_chromium_decision = {
		icon = GFX_decision_chromium
		priority = 8

		allowed = {
			original_tag = JAP
		}

		visible = {
			has_completed_focus = JAP_invest_in_foreign_industries
		}

		available = {
			NOT = { has_country_flag = JAP_currently_investing_in_foreign_industry_flag } 
		}

		cost = 50

		fire_only_once = yes

		days_remove = 30

		state_target = yes

		target_trigger = {
			FROM = {
				OWNER = {
					OR = {
						controls_state = PREV
						ROOT = {
							has_country_flag = JAP_currently_investing_in_foreign_industry_flag
						}
					}
				}
				OR = {
					state = 426 # Orissa
					state = 635 # New Caledonia 
					state = 411 # Isfahan
				}
			}
		}

		cancel_trigger = {
			FROM = {
				OWNER = {
					NOT = {
						has_full_control_of_state = PREV
					}
				}
			}
		}

		cancel_effect = {
			clr_country_flag = JAP_currently_investing_in_foreign_industry_flag
		}

		complete_effect = {
			set_country_flag = JAP_currently_investing_in_foreign_industry_flag
		}

		remove_effect = {
			clr_country_flag = JAP_currently_investing_in_foreign_industry_flag

			set_country_flag = JAP_requests_chromium_flag

			FROM.OWNER = {
				country_event = {
					id = SEA_japan_foreign_policy.89
					hours = 6
				}
			}

			custom_effect_tooltip = if_they_accept_tt
			custom_effect_tooltip = JAP_industrial_investment_descision_tt
		}
	}

	JAP_industrial_investment_for_rubber_decision = {
		icon = GFX_decision_rubber
		priority = 7

		allowed = {
			original_tag = JAP
		}

		visible = {
			has_completed_focus = JAP_invest_in_foreign_industries
		}

		available = {
			NOT = { has_country_flag = JAP_currently_investing_in_foreign_industry_flag } 
		}

		cost = 50

		fire_only_once = yes

		days_remove = 30

		state_target = yes

		target_trigger = {
			FROM = {
				OWNER = {
					OR = {
						controls_state = PREV
						ROOT = {
							has_country_flag = JAP_currently_investing_in_foreign_industry_flag
						}
					}
				}
				OR = {
					state = 724 # Northern Mandalay
					state = 1024 # Sabah 
					state = 673 # Sulawesi
					state = 333 # Sarawak 
				}
			}
		}

		cancel_trigger = {
			FROM = {
				OWNER = {
					NOT = {
						has_full_control_of_state = PREV
					}
				}
			}
		}

		cancel_effect = {
			clr_country_flag = JAP_currently_investing_in_foreign_industry_flag
		}

		complete_effect = {
			set_country_flag = JAP_currently_investing_in_foreign_industry_flag
		}

		remove_effect = {
			clr_country_flag = JAP_currently_investing_in_foreign_industry_flag

			set_country_flag = JAP_requests_rubber_flag

			FROM.OWNER = {
				country_event = {
					id = SEA_japan_foreign_policy.89
					hours = 6
				}
			}

			custom_effect_tooltip = if_they_accept_tt
			custom_effect_tooltip = JAP_industrial_investment_descision_tt
		}
	}

	# Attract Foreign Investments from FROM.GetName
	JAP_attract_foreign_investments_decision  = {

		priority = 5

		icon = GFX_decision_gre_investment_decisions

		ai_will_do = {
			base = 50
		}
	
		allowed = {  
			original_tag = JAP 
		}
	    
	    target_trigger = {
	        FROM = {
	        	is_major = yes
	        	NOT = {
	        		has_country_flag = JAP_has_already_attracted_inestments_from_here_flag
	        	}
	        	NOT = {
	        		has_war_with = ROOT
	        		is_subject_of = ROOT
	        	}
	        }
	    }

	    visible = { 
			has_completed_focus = JAP_seek_foreign_investments
		}
	
		available = {
			
			FROM = {
				has_opinion = {
					target = ROOT
					value > 74
				} 
			}
			
		}

		days_remove = 35

		cost = 75

		modifier = {
			political_power_factor = -0.05
		}

		complete_effect = { 
		}

		remove_effect = {
			
			random_owned_controlled_state = {
				limit = {
					is_core_of = ROOT
					free_building_slots = {
						building = industrial_complex
						size > 1
						include_locked = yes
					}	
				}
				add_extra_state_shared_building_slots = 2
				add_building_construction = {
					type = industrial_complex
					level = 2
					instant_build = yes
				}
			}

		}

	}


}




JAP_west_pacific_treaty_org_allied_trade_cat = {

	JAP_west_pacific_treaty_org_trade_decision = {
		priority = 1
		icon = GFX_decision_eng_trade_unions_support 

		ai_will_do = {
			base = 1
			modifier = {
				factor = 2
				any_enemy_country = {
					has_war_with = FROM
				}
			}
			modifier = {
				factor = 2
				FROM = {
					is_in_faction = no
				}
			}
			modifier = {
				factor = 3
				FROM = {
					any_core_state = {
						is_fully_controlled_by = FROM
						OR = {
							has_resources_amount = {
								resource = oil
								amount > 14
							}
							has_resources_amount = {
								resource = aluminium
								amount > 14
							}
							has_resources_amount = {
								resource = rubber
								amount > 14
							}
							has_resources_amount = {
								resource = tungsten
								amount > 14
							}
							has_resources_amount = {
								resource = steel
								amount > 14
							}
							has_resources_amount = {
								resource = chromium
								amount > 14
							}
							has_resources_amount = {
								resource = coal
								amount > 14
							}
						}
					}
				}
			}
			modifier = {
				factor = 3
				FROM = {
					any_core_state = {
						is_fully_controlled_by = FROM
						OR = {
							has_resources_amount = {
								resource = oil
								amount > 24
							}
							has_resources_amount = {
								resource = aluminium
								amount > 24
							}
							has_resources_amount = {
								resource = rubber
								amount > 24
							}
							has_resources_amount = {
								resource = tungsten
								amount > 24
							}
							has_resources_amount = {
								resource = steel
								amount > 24
							}
							has_resources_amount = {
								resource = chromium
								amount > 24
							}
							has_resources_amount = {
								resource = coal
								amount > 24
							}
						}
					}
				}
			}
			modifier = {
				factor = 0.5
				FROM = {
					is_enemy_ideology = yes
				}
			}
			modifier = {
				factor = 2
				FROM = {
					has_government = ROOT
				}
			}
		}

		target_array = ROOT.allies

		target_trigger = {
			FROM = {
				is_subject = no
				NOT = {
					has_war_with = ROOT
				}
				NOT = { has_country_flag = JAP_trade_agreement_event_flag }
				is_in_faction_with = ROOT
				NOT = {
					has_idea = JAP_customs_union_trade_idea
				}
				any_core_state = {
					is_fully_controlled_by = FROM
					OR = {
						has_resources_amount = {
							resource = oil
							amount > 9
							delivered = yes

						}
						has_resources_amount = {
							resource = aluminium
							amount > 9
							delivered = yes
						}
						has_resources_amount = {
							resource = rubber
							amount > 9
							delivered = yes
						}
						has_resources_amount = {
							resource = tungsten
							amount > 9
							delivered = yes
						}
						has_resources_amount = {
							resource = steel
							amount > 9
							delivered = yes
						}
						has_resources_amount = {
							resource = chromium
							amount > 9
							delivered = yes
						}
						has_resources_amount = {
							resource = coal
							amount > 9
							delivered = yes
						}
					}
				}
			}
		}

		available = {
		}

		visible = {	
			has_completed_focus = JAP_form_greater_east_asian_customs_union
		}

		fire_only_once = yes

		cost = 25

		complete_effect = {

			FROM = {
				country_event = {
					id = SEA_japan_foreign_policy.97
					hours = 6
					random_hours = 12
				}
				set_country_flag = JAP_trade_agreement_event_flag
			}

			custom_effect_tooltip = if_they_accept_tt

			effect_tooltip = {
				FROM = {
					add_ideas = JAP_customs_union_trade_idea
					add_opinion_modifier = {
						target = PREV
						modifier = JAP_trading_partners
					}
					custom_effect_tooltip = war_will_cancel_deal_tt
				}
			}
		}
	}
}


JAP_west_pacific_treaty_org_economic_integration_cat = {
	
	JAP_west_pacific_treaty_org_currency_union_decision = {
		priority = 5
		icon = GFX_decision_gre_investment_decisions 

		ai_will_do = {
			base = 2
			modifier = {
				factor = 2
				any_enemy_country = {
					has_war_with = FROM
				}
			}
			modifier = {
				factor = 0.5
				FROM = {
					is_enemy_ideology = yes
				}
			}
			modifier = {
				factor = 2
				FROM = {
					has_government = ROOT
				}
			}
			modifier = {
				factor = 2
				strength_ratio = {
				    tag = FROM
				    ratio < 0.75
				}
			}
			modifier = {
				factor = 2
				strength_ratio = {
				    tag = FROM
				    ratio < 0.5
				}
			}
		}

		target_array = ROOT.allies

		target_trigger = {
			FROM = {
				capital_scope = { 
					OR = {
						is_on_continent = asia 
						is_on_continent = australia 
						is_on_continent = middle_east 
					}
				}
				is_in_faction_with = ROOT
				NOT = {
					has_idea = JAP_pacific_customs_union_member
					has_idea = JAP_pacific_integrated_customs_union_member
				}
			}
		}

		available = {
		}

		visible = {	
			has_completed_focus = JAP_form_greater_east_asian_currency_union
		}

		fire_only_once = yes

		cost = 15

		complete_effect = {

			FROM = {
				country_event = {
					id = SEA_japan_foreign_policy.100
					hours = 6
					random_hours = 12
				}	
			}

			custom_effect_tooltip = if_they_accept_tt

			effect_tooltip = {
				FROM = {
					add_ideas = JAP_pacific_customs_union_member
				}
			}
		}
	}

	JAP_west_pacific_treaty_org_economic_integration_decision = {
		priority = 3
		icon = GFX_decision_eng_trade_unions_support 

		ai_will_do = {
			base = 5
			modifier = {
				factor = 2
				any_enemy_country = {
					has_war_with = FROM
				}
			}
			modifier = {
				factor = 0.5
				FROM = {
					is_enemy_ideology = yes
				}
			}
			modifier = {
				factor = 2
				FROM = {
					has_government = ROOT
				}
			}
			modifier = {
				factor = 2
				strength_ratio = {
				    tag = FROM
				    ratio < 0.75
				}
			}
			modifier = {
				factor = 2
				strength_ratio = {
				    tag = FROM
				    ratio < 0.5
				}
			}
		}

		target_array = ROOT.allies

		target_trigger = {
			FROM = {
				is_in_faction_with = ROOT
				capital_scope = { 
					OR = {
						is_on_continent = asia 
						is_on_continent = australia 
						is_on_continent = middle_east 
					}
				}
				is_subject = no
				has_idea = JAP_pacific_customs_union_member
				NOT = {
					OR = {
						has_country_flag = JAP_has_sent_invitation_for_integration_once_already_flag
						has_country_flag = JAP_country_that_rejected_economic_integration_flag
					}
				}
			}
		}

		available = {
		}

		visible = {	
			has_completed_focus = JAP_an_integrated_union
		}

		fire_only_once = yes

		cost = 25

		complete_effect = {
			FROM = {
				country_event = { id = SEA_japan_foreign_policy.103 days = 1 } 
				set_country_flag = JAP_has_sent_invitation_for_integration_once_already_flag
			}

			custom_effect_tooltip = if_they_accept_tt

			effect_tooltip = {
				FROM = {
					swap_ideas = {
						remove_idea = JAP_pacific_customs_union_member
						add_idea = JAP_pacific_integrated_customs_union_member
					}
				}
			}
		}
	}

	JAP_further_increase_froms_dependency_decision = {
		icon = GFX_decision_eng_trade_unions_demand
		priority = 2

		ai_will_do = {
			base = 50
		}
		
		fire_only_once = yes

		target_array = ROOT.allies

		target_trigger = {
			FROM = {
				is_in_faction_with = ROOT
				capital_scope = { 
					OR = {
						is_on_continent = asia 
						is_on_continent = australia 
						is_on_continent = middle_east 
					}
				}
				is_subject = no
				has_idea = JAP_pacific_integrated_customs_union_member
				NOT = { has_country_flag = JAP_sent_puppet_proposal_flag }
			}
		}

		visible = {
			has_completed_focus = JAP_an_integrated_union
		}

		available = {
			is_subject = no
			is_faction_leader = yes
		}

		days_remove = 35

		cost = 50

		complete_effect = {
		}

		remove_effect = {
			FROM = {
				country_event = {
					id = SEA_japan_foreign_policy.106 
					hours = 12
				}
				set_country_flag = JAP_sent_puppet_proposal_flag
			}
			custom_effect_tooltip = if_they_accept_tt
			effect_tooltip = {
				puppet = FROM
			}
			
		}
	}

	JAP_annex_integrated_puppet_decision = {
		icon = GFX_decision_eng_trade_unions_demand
		priority = 10

		ai_will_do = {
			base = 50
		}
		
		fire_only_once = yes

		target_array = ROOT.subjects

		target_trigger = {
			FROM = {
				is_subject_of = ROOT
				capital_scope = { 
					OR = {
						is_on_continent = asia 
						is_on_continent = australia 
						is_on_continent = middle_east 
					}
				}
				NOT = { has_country_flag = JAP_sent_annex_proposal_flag }
				#is_neighbor_of = ROOT 
			}
		}

		visible = {
			has_completed_focus = JAP_greater_east_asian_federation
		}

		available = {
			is_subject = no
			has_government = democratic
		}

		days_remove = 70

		cost = 200

		complete_effect = {
		}

		remove_effect = {
			FROM = {
				country_event = {
					id = SEA_japan_foreign_policy.109
					hours = 12
				}
				set_country_flag = JAP_sent_annex_proposal_flag
			}
			custom_effect_tooltip = if_they_accept_tt
			effect_tooltip = {
				annex_country = {
					target = FROM
					transfer_troops = yes
				}	
				FROM = {
					every_core_state = {
						add_core_of = ROOT
					}
				}
			}
			
		}
	}

	JAP_democratic_core_asian_state = {

		icon = GFX_decision_generic_form_nation

		ai_will_do = {
			base = 50
		}

		priority = 25

		#highlight_states = {
		#	highlight_state_targets = {
		#		state = FROM 
		#	} 
		#}
	
		allowed = {
			original_tag = JAP
		}
		
		visible = {
			has_completed_focus = JAP_greater_east_asian_federation
		}
		
		available = {
			FROM = {
				NOT = { has_state_flag = JAP_coring_this_asian_state_in_progress_flag }
			}
			FROM = {
				compliance > 50
			}
		}

		state_target = any_controlled_state
	    
	    target_trigger = {
	        FROM = {
	        	NOT = { is_core_of = ROOT }
	        	is_fully_controlled_by = ROOT
	        	OR = {
	        		is_on_continent = asia
	        		is_on_continent = middle_east
	        		is_on_continent = australia
	        	}
	        	OR = {
	        		any_neighbor_state = {
	        			is_core_of = ROOT
	        		}
	        		is_coastal = yes
	        	}
	        }
	    }
	    on_map_mode = map_only

	    cost = 50		

		fire_only_once = yes

		days_remove = 35

		complete_effect = {
			hidden_effect = {
				FROM = {
					set_state_flag = { flag = JAP_coring_this_asian_state_in_progress_flag value = 1 days = 31 }
				}
			}
		}

		remove_effect = {
			hidden_effect = {
				FROM = {
					clr_state_flag = JAP_coring_this_asian_state_in_progress_flag
				}
			}

			FROM = {
				add_core_of = ROOT
			}
			
		}

		cancel_trigger = {
			FROM = {
				NOT = { is_fully_controlled_by = ROOT }
			}
		}

		cancel_effect = {
			hidden_effect = {
				FROM = {
					clr_state_flag = JAP_coring_this_asian_state_in_progress_flag
				}
			}
		}
	}

}



JAP_anti_colonialism_category = {
	
	JAP_support_resistance_decision = {
		icon = GFX_decision_generic_nationalism
		
		target_array = JAP.asian_colonial_states_array 
		target_root_trigger = { original_tag = JAP } 

		target_trigger = {
			#Target is FROM
			FROM = {
				NOT = {
					has_dynamic_modifier = {
						modifier = JAP_state_supporting_resistance_modifier
						scope = THIS.owner 
					}
				}
			} 
			FROM = { NOT = { is_core_of = THIS.owner } } # Hide it if no longer a colony 
			FROM = { NOT = { is_owned_by = ROOT } }# It gets kind of silly when you start supporting resistance against yourself, doesn't it
		}

		state_target = yes
		on_map_mode = map_only
		fire_only_once = yes 
		available = {
			NOT = { has_country_flag = JAP_independence_support_progress_flag }
			NOT = { FROM.owner = { is_in_faction_with = ROOT } }
			FROM.owner = { controls_state = FROM } 
		}

		visible = {
			
		}
		days_remove = 30
	
		custom_cost_trigger = {
			command_power > 24.9
		}
		custom_cost_text = ETH_support_resistance_decision_cost

		modifier = {
			industrial_capacity_factory = -0.15
		}

		complete_effect = {
			set_country_flag = JAP_independence_support_progress_flag
			hidden_effect = {
				add_command_power = -25
			}
		}

		remove_effect = {
			clr_country_flag = JAP_independence_support_progress_flag
			FROM = {
				add_compliance = -35
				add_resistance = 15  
				add_dynamic_modifier = {
					modifier = JAP_state_supporting_resistance_modifier
					scope = THIS.owner 
					days = 365
				}
				add_dynamic_modifier = {
					modifier = JAP_pro_japanese_sentiment_in_state
					days = 365
					scope = JAP
				}
			}
		}

		ai_will_do = {
			base = 0
			modifier = {
				add = 175
				AND = {
					has_war = no 
					command_power > 74
				}
			}
			modifier = {
				factor = 2
				has_government = communism
			}
		}
	}

	JAP_arm_resistance_decision = {
		icon = GFX_decision_generic_prepare_civil_war
		target_array = JAP.asian_colonial_states_array 
		target_root_trigger = { original_tag = JAP } 
		target_trigger = {
			FROM = {
				has_dynamic_modifier = {
					modifier = JAP_state_supporting_resistance_modifier
					scope = THIS.owner 
				}
			} 
			FROM = { NOT = { is_core_of = THIS.owner } } # Hide it if no longer a colony 
		}
		state_target = yes
		on_map_mode = map_only
		fire_only_once = yes 
		available = {
			NOT = { FROM.owner = { is_in_faction_with = ROOT } }
			NOT = { has_country_flag = JAP_arm_resistance_flag }
			FROM.owner = { controls_state = FROM } 
		}
		visible = {
			

		}
		days_remove = 7
		custom_cost_trigger = {
			has_equipment = { infantry_equipment > 999 }
		}
		custom_cost_text = decision_cost_ie_1000
		modifier = {
	
		}
		complete_effect = {
			add_equipment_to_stockpile = {
				type = infantry_equipment
				amount = -1000
			}
			set_country_flag = JAP_arm_resistance_flag	
		}
		remove_effect = {
			clr_country_flag = JAP_arm_resistance_flag
			FROM = {
				add_resistance = 40
			}
		}
		ai_will_do = {
			base = 0
			modifier = {
				add = 25
				has_war = no 
				has_equipment = { infantry_equipment > 999 }
			}
			modifier = {
				add = 50
				has_war = no 
				has_equipment = { infantry_equipment > 2999 }
			}
			modifier = {
				add = 50
				has_war = no 
				has_equipment = { infantry_equipment > 4999 }
			}
			modifier = {
				factor = 2
				has_government = communism
			}
		}
	}




}

# The Ashigaru
JAP_ashigaru_category = {
	
	JAP_expand_banner_recruitment = {
		icon = GFX_decision_generic_military 
	
		allowed = {
			original_tag = JAP
		}
	
		available = {
			check_variable = { JAP_levy_cap < JAP_levy_cap_max }
			custom_trigger_tooltip = {
				tooltip = JAP_expand_ashigaru_tt
				check_variable = { JAP_levy_cap < JAP_levy_cap_max }
			}
			has_war = no
			NOT = {
				has_country_flag = JAP_raise_ashigaru_active
			}
		}
		
		visible = {
		}
	
	    custom_cost_trigger = {
	    	command_power > 14.9
	    }
	    custom_cost_text = AFG_decision_cost_quami

	    ai_will_do = {
	    	base = 25
	    }
		
		fire_only_once = no
		days_remove = 7
		complete_effect = {
			add_command_power = -15
		}
		remove_effect = {

			custom_effect_tooltip = JAP_expand_ashigaru_tt_2

			hidden_effect = {
				add_to_variable = { JAP_levy_cap = 1 }
				clamp_variable = {
					var = JAP_levy_cap
					min = JAP_levy_cap_min
					max = JAP_levy_cap_max
				}
				set_division_template_cap = { 
					division_template = "Ashigaru Levy" 
					division_cap = JAP_levy_cap   
				}
			}
		}
	}

	JAP_raise_the_ashigaru = {
		icon = GFX_decision_generic_prepare_civil_war
	
		allowed = {
			original_tag = JAP
		}
	
		available = {
			OR = {
				has_defensive_war = yes
				AND = {
					has_war_support > 0.45
					has_offensive_war = yes
				}
			}
			NOT = { has_country_flag = JAP_raise_ashigaru_active }
			has_civil_war = no
		}
		
		visible = {
		}
	
		cost = 25

		ai_will_do = {
			base = 250
		}
		
		fire_only_once = no
		days_remove = 14
		remove_effect = {
			
			set_country_flag = JAP_raise_ashigaru_active
			custom_effect_tooltip = JAP_raise_ashigaru_tt
			add_stability = -0.05
			set_variable = { deployed_divs = 0 }
			while_loop_effect = {
				limit = {
					check_variable = { deployed_divs < JAP_levy_cap }
				}
				add_to_variable = { deployed_divs = 1 }
				capital_scope = {
					create_unit = {
						division = "division_template =\"Ashigaru Levy\" start_experience_factor = 0.4 start_equipment_factor = 1.0"
						owner = JAP
						count = 1			
						prioritize_location = 1097
					}
				}
			}
		}
	}

	JAP_demobilize_the_ashigaru = {
		icon = GFX_decision_SWI_dismiss_council
	
		allowed = {
			original_tag = JAP
		}
	
		available = {
			has_country_flag = JAP_raise_ashigaru_active
		}
		
		visible = {
		}
	
		cost = 5

		ai_will_do = {
			base = 0
			modifier = {
				add = 100
				has_war = no
			}
		}
		
		fire_only_once = no
		days_remove = 7
		complete_effect = {
		}
		remove_effect = {
			custom_effect_tooltip = JAP_send_home_ashigaru_tt
			add_stability = 0.1
			clr_country_flag = JAP_raise_ashigaru_active
			set_variable = { deployed_divs = 0 }
			delete_units = {
				division_template = "Ashigaru Levy"
				disband = no
			}
			
		}
	}

}

# The Boeitai
JAP_boeitai_category = {
	
	JAP_expand_boeitai_recruitment = {
		icon = GFX_decision_generic_military 
	
		allowed = {
			original_tag = JAP
		}
	
		available = {
			check_variable = { JAP_levy_cap < JAP_levy_cap_max }
			custom_trigger_tooltip = {
				tooltip = JAP_expand_boeitai_tt
				check_variable = { JAP_levy_cap < JAP_levy_cap_max }
			}
			has_war = no
			NOT = {
				has_country_flag = JAP_raise_boeitai_active
			}
		}
	
	    custom_cost_trigger = {
	    	command_power > 14.9
	    }
	    custom_cost_text = AFG_decision_cost_quami

	    ai_will_do = {
	    	base = 25
	    }
		
		fire_only_once = no
		days_remove = 7
		complete_effect = {
			add_command_power = -15
		}
		remove_effect = {

			custom_effect_tooltip = JAP_expand_boeitai_tt_2

			hidden_effect = {
				add_to_variable = { JAP_levy_cap = 1 }
				clamp_variable = {
					var = JAP_levy_cap
					min = JAP_levy_cap_min
					max = JAP_levy_cap_max
				}
				set_division_template_cap = { 
					division_template = "Kokumin Giyū Sentōtai" 
					division_cap = JAP_levy_cap   
				}
			}
		}
	}

	JAP_raise_the_boeitai = {
		icon = GFX_decision_generic_prepare_civil_war
	
		allowed = {
			original_tag = JAP
		}
	
		available = {
			OR = {
				has_defensive_war = yes
				AND = {
					has_war_support > 0.45
					has_offensive_war = yes
				}
			}
			NOT = { has_country_flag = JAP_raise_boeitai_active }
			has_civil_war = no
		}
		
		visible = {
		}
	
		cost = 25

		ai_will_do = {
			base = 250
		}
		
		fire_only_once = no
		days_remove = 14
		remove_effect = {
			
			set_country_flag = JAP_raise_boeitai_active
			custom_effect_tooltip = JAP_raise_boeitai_tt
			add_stability = -0.05
			set_variable = { deployed_divs = 0 }
			while_loop_effect = {
				limit = {
					check_variable = { deployed_divs < JAP_levy_cap }
				}
				add_to_variable = { deployed_divs = 1 }
				capital_scope = {
					create_unit = {
						division = "division_template =\"Kokumin Giyū Sentōtai\" start_experience_factor = 0.4 start_equipment_factor = 1.0"
						owner = JAP
						count = 1			
						prioritize_location = 1097
					}
				}
			}
		}
	}

	JAP_demobilize_the_boeitai = {
		icon = GFX_decision_SWI_dismiss_council
	
		allowed = {
			original_tag = JAP
		}
	
		available = {
			has_country_flag = JAP_raise_boeitai_active
		}
		
		visible = {
		}
	
		cost = 5

		ai_will_do = {
			base = 0
			modifier = {
				add = 100
				has_war = no
			}
		}
		
		fire_only_once = no
		days_remove = 7
		complete_effect = {
		}
		remove_effect = {
			custom_effect_tooltip = JAP_send_home_boeitai_tt
			add_stability = 0.1
			clr_country_flag = JAP_raise_boeitai_active
			set_variable = { deployed_divs = 0 }
			delete_units = {
				division_template = "Kokumin Giyū Sentōtai"
				disband = no
			}
			
		}
	}

}

# Tecnically not a Japan only thing, but a "all chinese enemies one"
war_measures = {


	CHI_china_pledging_to_hold_state_mission = {

		icon = GFX_decision_generic_prepare_civil_war

		highlight_states = {
			highlight_states_trigger = {
				has_state_flag = CHI_holding_state_mission_flag
			} 
		}

		allowed = {
			always = no #overridden by activate_mission
		}

		visible = {
			has_war_with = CHI
			is_major = yes
		}

		available = {
			custom_trigger_tooltip = {
				tooltip = CHI_holding_state_mission_trigger
				CHI = {
					NOT = {
						has_active_mission = CHI_holding_state_mission
					}
				}
			}
			
		}
		
		days_mission_timeout = CHI.CHI_holding_state_mission_time_var 

		complete_effect = {

			effect_tooltip = {
				CHI = {
					add_war_support = -0.05
				}
			}

		}

		is_good = no

		timeout_effect = {

			effect_tooltip = {
				CHI = {
					add_war_support = 0.05
					add_cic = var:demonstrate_resolve_cic_reward
					if = {
						limit = {
							NOT = {
								has_dynamic_modifier = {
									modifier = CHI_american_support
								}
							}
						}

						add_equipment_to_stockpile = {
							type = artillery_equipment
							amount = var:demonstrate_resolve_art_reward
							producer = SOV
						}
					}
					else = {
						add_equipment_to_stockpile = {
							type = artillery_equipment
							amount = var:demonstrate_resolve_art_reward
							producer = USA
						}
					}
					every_subject_country = {
						add_autonomy_score = { 
							value = -30 
							localization = CHI_holding_state_mission
						}
					}
				}
			}

			
		}
		
	}


}

# The Burmah Oil Company's Oil Fields - for blowing up and repairing the Burmese oil fields 
BRM_burmah_oils_oil_fields = {
	
	BRM_blow_up_the_oil_fields = {

		icon = GFX_decision_generic_ignite_civil_war

		highlight_states = {
			highlight_state_targets = {
				state = 288 
			} 
		}

		allowed = { 
			
		}

		visible = {
				
			288 = {
				is_controlled_by_ROOT_or_subject = yes
			}
			
			is_subject = no
			has_capitulated = no

			NOT = {
				288 = {
					has_dynamic_modifier = { modifier = BRM_blown_up_oil_fields }
				}
			}
			
		}

		available = {
			has_war = yes
			288 = {
				any_neighbor_state = {
					controller = {
						has_war_with = ROOT
					}
				}	
			}	
		}

		cost = 25
		
		cancel_trigger = {
			OR = {
				has_war = no
				288 = {
					is_controlled_by_ROOT_or_subject = no
				}
			}
		}

		ai_will_do = {
			base = 0
			modifier = {
				controls_state = 288
				surrender_progress > 0.15
				add = 150
			}
			modifier = {
				any_subject_country = {
					is_subject_of = ROOT
					controls_state = 288
					surrender_progress > 0.15
				}
				add = 150
			}
			modifier = {
				288 = {
					state_is_fully_controlled_by_ROOT_or_subject = no
				}
				add = 100
			}
		}

		days_remove = 20

		remove_effect = {

			288 = {
				add_dynamic_modifier = {
					modifier = BRM_blown_up_oil_fields
				}
			}

		}

	}

	BRM_repair_the_oil_fields = {

		icon = GFX_decision_generic_construction

		highlight_states = {
			highlight_state_targets = {
				state = 288 
			} 
		}

		visible = {

			288 = {
				is_controlled_by_ROOT_or_subject = yes
				has_dynamic_modifier = { modifier = BRM_blown_up_oil_fields }
			}
			
			has_capitulated = no
			is_subject = no 
		}

		modifier = {
			civilian_factory_use = 10
		}

		available = {
			num_of_civilian_factories_available_for_projects > 9
		}

		cost = 25

		cancel_trigger = {
			288 = {
				is_controlled_by_ROOT_or_subject = no
			}
		}

		ai_will_do = {
			base = 0
			modifier = {
				controls_state = 288
				has_war = no
				add = 150
			}
			modifier = {
				any_subject_country = {
					is_subject_of = ROOT
					controls_state = 288
				}
				has_war = no
				add = 150
			}
			modifier = {
				surrender_progress < 0.1
				add = 50 
			}
		}

		days_remove = 120

		remove_effect = {

			288 = {
				remove_dynamic_modifier = {
					modifier = BRM_blown_up_oil_fields
				}
			}

		}
	}

}


