DOM_japanse_missions_1 = {
	slot = 1
	generic = no
	ai = yes
	potential_on_load = {
		has_dlc = "Domination" 
	}
	potential = {
		tag = JAP 
		has_dlc = "Domination" 
		NOT = { map_setup = map_setup_random }
	}
	has_country_shield = yes
	
	jap_balance_shinokosho = {
		icon = jap_balance_shinokosho
		required_missions = { }
		position = 1
		provinces_to_highlight = {
			owned_by = ROOT 
			controlled_by = REB 
		}
		trigger = {
			if = {
				limit = { ai = no }
				stability = 2 
				if = {
					limit = { has_estate = estate_burghers } 
					estate_loyalty = {
						estate = estate_burghers
						loyalty = 60 
					}
				}
				if = {
					limit = { has_estate = estate_nobles } 
					estate_loyalty = {
						estate = estate_nobles
						loyalty = 60 
					}
				}
				if = {
					limit = { has_estate = estate_church } 
					estate_loyalty = {
						estate = estate_church
						loyalty = 60 
					}
				}
			}
			else = {
				stability = 1
				if = {
					limit = { has_estate = estate_burghers } 
					estate_loyalty = {
						estate = estate_burghers
						loyalty = 50 
					}
				}
				if = {
					limit = { has_estate = estate_nobles } 
					estate_loyalty = {
						estate = estate_nobles
						loyalty = 50 
					}
				}
				if = {
					limit = { has_estate = estate_church } 
					estate_loyalty = {
						estate = estate_church
						loyalty = 50 
					}
				}
			}
			NOT = { num_of_rebel_controlled_provinces = 1 } 
		}
		effect = {
			add_country_modifier = { 
				name = jap_stability_edo_period_modifier
				duration = -1 
				desc = until_end_of_age_desc 
			}
		}
	}
	
	jap_nanban_trade = {
		icon = mission_asian_trader
		required_missions = { jap_balance_shinokosho }
		position = 3
		provinces_to_highlight = {
			
		}
		trigger = {
			if = { 
				limit = { 
					has_dlc = "Mandate of Heaven" 
					religion = shinto 
				}
				custom_trigger_tooltip = {
					tooltip = jap_had_nanban_trade_tt
					has_country_flag = end_of_nanban_chain 
				}
				NOT = { is_incident_active = incident_nanban }
			}
			num_of_owned_provinces_with = {
				has_trade_building_trigger = yes 
				value = 8 
			}
			OR = {
				dip = 5 
				ruler_has_personality = entrepreneur_personality 
				full_idea_group = trade_ideas 
				monthly_dip = 12 
			}
		}
		effect = {
			custom_tooltip = jap_kaikoku_tt
			tooltip = {
				swap_non_generic_missions = yes 
				add_country_modifier = { 
					name = jap_exchange_ideas_modifier 
					duration = 9125 
				}
				if = { 
					limit = { has_dlc = "Rights of Man" NOT = { num_of_ruler_traits = { amount = 3 } } } 
					add_ruler_personality = scholar_personality 
				}
				else = { change_ruler_stat = { type = dip amount = 1 } }
			}
			
			custom_tooltip = jap_trade_with_the_west_tt
			
			custom_tooltip = jap_sakoku_tt
			tooltip = {
				japan_region = { 
					limit = { owned_by = ROOT } 
					add_province_modifier = { 
						name = jap_sakoku_modifier 
						duration = -1 
					} 
				}
			}
			
			custom_tooltip = jap_if_no_moh_tt
			tooltip = {
				add_country_modifier = { 
					name = jap_trade_innovations_modifier 
					duration = 10950 
				}
			}
			
			hidden_effect = {
				if = {
					limit = { has_country_flag = jap_chose_kaikoku_flag }
					add_country_modifier = { 
						name = jap_exchange_ideas_modifier 
						duration = 9125 
					}
					swap_non_generic_missions = yes 
					if = { 
						limit = { has_dlc = "Rights of Man" NOT = { num_of_ruler_traits = { amount = 3 } } } 
						add_ruler_personality = scholar_personality 
					}
					else = { change_ruler_stat = { type = dip amount = 1 } }
					
				}
				else_if = {
					limit = { has_country_flag = jap_chose_trade_with_west_flag }
					swap_non_generic_missions = yes 
					every_owned_province = { 
						limit = { has_trade_building_trigger = yes } 
						upgrade_building = { trade = yes }  
						add_base_production = 1 
					}
				}
				else_if = {
					limit = { has_country_flag = jap_chose_sakoku_flag }
					japan_region = { 
						limit = { owned_by = ROOT } 
						add_province_modifier = { 
							name = jap_sakoku_modifier 
							duration = -1 
						}
					}
				}
				else = { 
					add_country_modifier = { 
						name = jap_trade_innovations_modifier 
						duration = 10950 
					}
				}
			}
		}
	}
	
	jap_expand_gokaido = {
		icon = dominant_economy
		required_missions = { jap_nanban_trade }
		position = 4
		provinces_to_highlight = {
			AND = { 	
				OR = { 
					province_id = 1020
					province_id = 1835
					province_id = 4188
					province_id = 1843
					province_id = 1028
					province_id = 4359
					province_id = 1030
					province_id = 4360
					province_id = 1839
					province_id = 4189
					province_id = 1029
					province_id = 1026
					province_id = 4191
				}
				OR = { 
					NOT = { num_of_times_improved = 5 }
					NOT = { num_of_buildings_in_province = 3 }
				}
			}
		}
		trigger = {
			reform_level = 8
			1020 = { num_of_times_improved = 5 num_of_buildings_in_province = 3 }
			1835 = { num_of_times_improved = 5 num_of_buildings_in_province = 3 }
			4188 = { num_of_times_improved = 5 num_of_buildings_in_province = 3 }
			1843 = { num_of_times_improved = 5 num_of_buildings_in_province = 3 }
			1028 = { num_of_times_improved = 5 num_of_buildings_in_province = 3 }
			4359 = { num_of_times_improved = 5 num_of_buildings_in_province = 3 }
			1030 = { num_of_times_improved = 5 num_of_buildings_in_province = 3 }
			4360 = { num_of_times_improved = 5 num_of_buildings_in_province = 3 }
			1839 = { num_of_times_improved = 5 num_of_buildings_in_province = 3 }
			4189 = { num_of_times_improved = 5 num_of_buildings_in_province = 3 }
			1029 = { num_of_times_improved = 5 num_of_buildings_in_province = 3 }
			1026 = { num_of_times_improved = 5 num_of_buildings_in_province = 3 }
			4191 = { num_of_times_improved = 5 num_of_buildings_in_province = 3 }
		}
		effect = {
			if = { 
				limit = { has_dlc = "Rights of Man" NOT = { num_of_ruler_traits = { amount = 3 } } } 
				add_ruler_personality = great_engineer_personality 
			}
			else = { change_ruler_stat = { type = adm amount = 1 } }
			change_government_reform_progress = 50 
			add_government_reform = jap_gokaido_reform
		}
	}
	
	jap_conquer_south_china = {
		icon = mission_to_the_south_china_sea
		required_missions = { }
		position = 6
		provinces_to_highlight = {
			region = south_china_region 
			NOT = { country_or_non_sovereign_subject_holds = ROOT } 
		}
		trigger = {
			num_of_provinces_owned_or_owned_by_non_sovereign_subjects_with = {
				region = south_china_region 
				value = 25 
			}
			2174 = { country_or_non_sovereign_subject_holds = ROOT }
		}
		effect = {
			add_country_modifier = {
				name = jap_wealth_of_china_modifier 
				duration = -1 
			}
			
			2174 = {
				add_province_modifier = {	
					name = jap_expanded_mining_operations_modifier
					duration = 9125 
				}
			}
			
			if = {
				limit = { is_emperor_of_china = yes } 
				add_mandate = 20 
			}
			
			custom_tooltip = jap_malacca_claims_tt
			hidden_effect = {
				1361 = { 
					every_trade_node_member_province = {
						limit = { 
							NOT = { owned_by = ROOT }
							NOT = { is_core = ROOT } 
							NOT = { province_id = 1926 }
							NOT = { province_id = 1361 }
						}
						add_permanent_claim = ROOT 
					}
				}
			}
		}
	}
	
	jap_maraka_kaikyou = {
		icon = mission_sail_to_the_east_indies
		required_missions = { jap_conquer_south_china }
		position = 8
		provinces_to_highlight = {
			province_id = 1361 
		}
		trigger = {
			1361 = {
				trade_share = {
					country = ROOT 
					share = 55
				}
			}
			4815 = {
				country_or_non_sovereign_subject_holds = ROOT 
				num_of_times_improved = 10 
				has_trade_building_trigger = yes 
			}
		}
		effect = {
			country_event = { id = flavor_jap.62 }
			custom_tooltip = jap_event_insight_62_tt
		}
	}
}

japanese_missions_eoc_1 = {
	slot = 1
	generic = no
	ai = yes
	potential = {
		has_dlc = "Domination"
		is_emperor_of_china = yes 
		tag = JAP 
	}
	has_country_shield = yes 

	mng_cornerstone_empire2 = {
		icon = mission_cornerstone_empire 
		required_missions = {  }
		position = 9
		provinces_to_highlight = {
		}
		trigger = {
			OR = {
				AND = {
					estate_loyalty = {
						estate = estate_eunuchs 
						loyalty = 60 
					}
					num_of_estate_privileges = {
						estate = estate_eunuchs
						value = 5
					}
				}
				AND = { 
					custom_trigger_tooltip = {
						tooltip = mng_kept_restrictions_tt
						has_country_flag = mng_kept_restrictions_flag
					}
					has_adm_advisor = yes 
					has_dip_advisor = yes 
					has_mil_advisor = yes 
					crown_land_share = 40
				}
			}
		}
		
		effect = {
			custom_tooltip = mng_bow_to_eunuchs_tt
			tooltip = {
				add_country_modifier = { 
					name = mng_increased_eunuch_influence_modifier
					duration = 18250
				}
			}
			custom_tooltip = pol_alternatively_tt
			tooltip = { 
				if = {
					limit = { 
						has_dlc = "Mandate of Heaven" 
						is_emperor_of_china = yes 
					} 
					custom_tooltip = mng_palace_bureaucracy_benefits_tt
				}
				else = { 
					change_estate_land_share = {
						estate = all 
						share = -10
					}
					add_stability_or_adm_power = yes 
				}
			}
			hidden_effect = {
				if = {
					limit = { 
						has_country_flag = mng_kept_restrictions_flag
						has_adm_advisor = yes 
						has_dip_advisor = yes 
						has_mil_advisor = yes 
						crown_land_share = 40
						has_dlc = "Mandate of Heaven" 
						is_emperor_of_china = yes 
					}
					clr_country_flag = mng_kept_restrictions_flag 
					set_country_flag = mng_expanded_palace_bureaucracy_flag 
				}
				else_if = {
					limit = { 
						has_country_flag = mng_kept_restrictions_flag
						has_adm_advisor = yes 
						has_dip_advisor = yes 
						has_mil_advisor = yes 
						crown_land_share = 40
					}
					change_estate_land_share = {
						estate = all 
						share = -10
					}
					add_stability_or_adm_power = yes 
				}
				else = {
					add_country_modifier = { 
						name = mng_increased_eunuch_influence_modifier
						duration = 18250
					}
				}
			}
		}
	}
	
	mng_censorate2 = {
		icon = mission_censorate 
		required_missions = { mng_cornerstone_empire2 }
		position = 11
		
		trigger = {
			NOT = { corruption = 1 } 
			has_adm_advisor_3 = yes 
			has_dip_advisor_3 = yes 
			has_mil_advisor_3 = yes 
			stability = 3 
			NOT = { average_unrest = -5 }
			num_of_owned_provinces_with = { 
				has_courthouse_building_trigger = yes 
				value = 15 
			}
		}
		
		effect = {
			country_event = { id = flavor_mng.28 }
			custom_tooltip = mng_insight_28_tt
		}
	}
	
	mng_promote_grand_coordinators2 = {
		icon = mission_kowtow
		required_missions = { mng_censorate2 }
		position = 12 
		
		trigger = { 
			if = { 
				limit = { is_emperor_of_china = yes } 
				meritocracy = 90 
			}
			else = { legitimacy_equivalent = 90 } 
			if = {
				limit = { is_emperor_of_china = yes } 
				OR = {
					empire_of_china_has_active_decree = issue_the_great_warnings_decree
					AND = {
						monthly_adm = 10 
						estate_loyalty = {
							estate = estate_eunuchs
							loyalty = 60 
						}
						estate_influence = {
							estate = estate_eunuchs 
							influence = 60 
						}
					}
				}
			}
		}
		
		effect = {
			custom_tooltip = mng_enable_3_grand_coordinators_offices_tt
			set_country_flag = mng_enable_3_grand_coordinators_offices_flag 
		}
	}
}
	
DOM_japanse_missions_2_a = {
	slot = 2
	generic = no
	ai = yes
	potential_on_load = {
		has_dlc = "Domination" 
	}
	potential = {
		tag = JAP 
		has_dlc = "Domination" 
		NOT = { map_setup = map_setup_random }
	}
	has_country_shield = yes
	
	jap_edo_jidai = {
		icon = jap_edo_jidai
		required_missions = { }
		position = 1 
		provinces_to_highlight = {
			AND = {
				NOT = { province_id = 1032 }
				NOT = { province_id = 1015 }
				region = japan_region 
			}
			NOT = { country_or_non_sovereign_subject_holds = ROOT } 
			
		}
		trigger = {
			if = { 
				limit = { has_custom_ideas = no ai = no } 	
				custom_trigger_tooltip = {
					tooltip = jap_reg_except_1032_1015_tt
					japan_region = {
						type = all 
						OR = {
							province_id = 1032 
							province_id = 1015
							country_or_non_sovereign_subject_holds = ROOT 
						}
					}
				}
			}
			else = {
				japan_region = {
					type = all 
					country_or_non_sovereign_subject_holds = ROOT 
				}
			}
			if = {
				limit = { ai = no }
				NOT = { average_autonomy_above_min = 5 } 
			}
		}
		effect = {
			country_event = { id = flavor_jap.63 }
			
			custom_tooltip = jap_event_insight_63_tt
		}
	}
	
	jap_five_regent_houses = {
		icon = jap_five_regent_houses
		required_missions = { jap_balance_shinokosho jap_edo_jidai }
		position = 2
		trigger = {
			crown_land_share = 50 
			OR = {
				AND = {
					num_of_estate_privileges = {
						estate = estate_nobles 
						value = 3 
					}
					estate_loyalty = {
						estate = estate_nobles
						loyalty = 60
					}
				}
				AND = {
					NOT = { 
						num_of_estate_privileges = {
							estate = estate_nobles 
							value = 3 
						}
					}
					NOT = {
						estate_influence = {
							estate = estate_nobles 
							influence = 50 
						}
					}
				}
			}
		}
		effect = {
			custom_tooltip = jap_high_influence_nobles_tt
			tooltip = {
				add_estate_loyalty = {
					estate = estate_nobles 
					loyalty = 20 
				}
			}
			
			custom_tooltip = jap_low_influence_tt
			tooltip = { change_government_reform_progress = 100 }	

			hidden_effect = {
				if = {
					limit = { 
						num_of_estate_privileges = {
							estate = estate_nobles 
							value = 3 
						}
						estate_loyalty = {
							estate = estate_nobles
							loyalty = 60
						}
					}
					add_estate_loyalty = {
						estate = estate_nobles 
						loyalty = 20 
					}
					set_country_flag = jap_regency_ga_flag
				}
				else = {
					change_estate_land_share = {
						estate = all 
						share = -20
					}
					change_government_reform_progress = 100 
				}
			}
		}
	}
}

DOM_japanse_missions_2_dejima = {
	slot = 2
	generic = no
	ai = yes
	potential_on_load = {
		has_dlc = "Domination" 
	}
	potential = {
		tag = JAP 
		has_dlc = "Domination" 
		NOT = { map_setup = map_setup_random }
		OR = { 
			has_country_flag = jap_chose_trade_with_west_flag 
			has_country_flag = jap_chose_kaikoku_flag
		}
	}
	has_country_shield = yes
	
	jap_port_dejima = {
		icon = mission_market_place_with_asian_traders
		required_missions = { jap_nanban_trade }
		position = 4
		provinces_to_highlight = {
			province_id = 4182 
		}
		trigger = {
			4182 = { 
				development = 35 
				num_of_buildings_in_province = 5
				has_trade_building_trigger = yes 
			}
		}
		effect = {
			4182 = { 
				center_of_trade = 2 
				add_province_modifier = {
					name = dejima_port_entry_modifier
					duration = -1 
				}
				change_trade_goods = silk 
			} 
			
		}
	}
}

DOM_japanse_missions_2_b = {
	slot = 2
	generic = no
	ai = yes
	potential_on_load = {
		has_dlc = "Domination" 
	}
	potential = {
		tag = JAP 
		has_dlc = "Domination" 
		NOT = { map_setup = map_setup_random }
	}
	has_country_shield = yes
	
	jap_imjin_war = {
		icon = jap_imjin_war
		required_missions = {  }
		position = 5
		provinces_to_highlight = {
			region = korea_region 
			NOT = { country_or_non_sovereign_subject_holds = ROOT } 
		}
		trigger = {
			num_of_provinces_owned_or_owned_by_non_sovereign_subjects_with = {
				region = korea_region 
				value = 20 
			}
			2745 = { country_or_non_sovereign_subject_holds = ROOT } 
			735 = { country_or_non_sovereign_subject_holds = ROOT }
			num_of_provinces_owned_or_owned_by_non_sovereign_subjects_with = {
				region = korea_region 
				has_fort_building_trigger = yes 
				value = 5 
			}
		}
		effect = {
			add_army_tradition = 15
			
			custom_tooltip = jap_conquest_of_china_cb_tt
			set_country_flag = access_conquest_of_china_cb_flag 
			
			custom_tooltip = jap_dip_advisor_culture_conversion_cost_tt
			
			if = {
				limit = { has_dlc = "Leviathan" }
				custom_tooltip = jap_accept_korean_culture_lev_tt
			}
			else = {
				custom_tooltip = jap_accept_korean_culture_nonlev_tt
				tooltip = {
					add_country_modifier = {
						name = jap_korean_cooperation_modifier
						duration = 9125 
					}
				}
			}
			
			hidden_effect = {
				if = {
					limit = {
						accepted_culture = korean
						has_dlc = "Leviathan" 
					}
					set_country_flag = enable_korean_palace_flag
				}
				else_if = {
					limit = { accepted_culture = korean }
					add_country_modifier = {
						name = jap_korean_cooperation_modifier
						duration = 9125 
					}
				}
				else = { set_country_flag = jap_dip_advisor_culture_conversion_cost_flag }
			}
		}
	}
	
	jap_fate_mandate = {
		icon = jap_fate_mandate
		required_missions = { jap_imjin_war }
		position = 6
		provinces_to_highlight = {
			OR = {
				province_id = 1816 
				province_id = 1821 
				province_id = 667
			}
			NOT = { country_or_non_sovereign_subject_holds = ROOT } 
		}
		trigger = {
			OR = { 
				war_score_against = {
					who = event_target:EmperorOfChina
					value = 85 
				}
				AND = { 
					1816 = { country_or_non_sovereign_subject_holds = ROOT } 
					1821 = { country_or_non_sovereign_subject_holds = ROOT } 
					667 = { country_or_non_sovereign_subject_holds = ROOT } 
				}
			}
			grown_by_development = 650
		}
		effect = {
			custom_tooltip = jap_war_against_mandate_holder_tt
			tooltip = {
				country_event = { id = flavor_jap.64 }
			}
			
			custom_tooltip = pol_alternatively_tt
			tooltip = {
				add_country_modifier = {
					name = jap_scramble_for_china_modifier
					duration = 7300 
				}
			}
			hidden_effect = {
				if = {	
					limit = { 
						war_score_against = {
							who = event_target:EmperorOfChina
							value = 85 
						}
					}
					country_event = { id = flavor_jap.64 }
				}
				else = {
					add_country_modifier = {
						name = jap_scramble_for_china_modifier
						duration = 7300 
					}
				}
			}
		}
	}
	
	jap_hegemon_of_asia = { 
		icon = mission_chinese_general_riding
		required_missions = { jap_conquer_south_china jap_conquer_north_china jap_fate_mandate }
		position = 7
		provinces_to_highlight = {
			OR = { 
				region = north_china_region 
				region = south_china_region
			}
			NOT = { country_or_non_sovereign_subject_holds = ROOT }
		}
		trigger = {
			north_china_region = {
				type = all
				country_or_non_sovereign_subject_holds = ROOT 
			}
			south_china_region = {
				type = all
				country_or_non_sovereign_subject_holds = ROOT 
			}
			OR = { 
				total_development = 2000
				NOT = { great_power_rank = 4 }
			}
		}
		effect = {
			add_country_modifier = {
				name = jap_masters_dragon_throne_modifier
				duration = -1 
			}
			
			if = {
				limit = { 
					is_emperor_of_china = yes 
					has_dlc = "Mandate of Heaven" 
				}
				custom_tooltip = jap_enable_fabricating_trib_CB_tt
				set_country_flag = jap_enable_fabricating_trib_CB_flag 
				
				add_country_modifier = {
					name = jap_divine_aspirations_modifier
					duration = -1 
				}
			}
			else_if = {
				limit = { 
					is_emperor_of_china = no 
					has_dlc = "Mandate of Heaven" 
				}
				custom_tooltip = jap_reward_if_EoC_tt
				custom_tooltip = jap_enable_fabricating_trib_CB_tt
				tooltip = {
					add_country_modifier = {
						name = jap_divine_aspirations_modifier
						duration = -1 
					}
				}
			}
		}
	}
}

japanese_missions_eoc_2 = {
	slot = 2
	generic = no
	ai = yes
	potential = {
		has_dlc = "Domination"
		is_emperor_of_china = yes 
		tag = JAP 
		capital_scope = { continent = asia }
	}
	has_country_shield = yes 
	
	mng_reform_civil_registration2 = {
		icon = mission_plc_governance_act 
		required_missions = { } 
		position = 9
		
		trigger = {
			if = {
				limit = {
					is_emperor_of_china = yes 
					has_dlc = "Mandate of Heaven" 
				}
				OR = { 
					empire_of_china_reform_passed = reform_civil_registration_decision
					imperial_mandate = 85 
				}
			}
			OR = {
				absolutism = 50
				custom_trigger_tooltip = {
					tooltip = mng_all_available_estates_granted_land_rights_tt
					if = {
						limit = { has_estate = estate_eunuchs } 
						has_estate_privilege = estate_eunuchs_land_rights_privilege
					}
					if = {
						limit = { has_estate = estate_burghers } 
						has_estate_privilege = estate_burghers_land_rights 
					}
					if = {
						limit = { has_estate = estate_nobles } 
						has_estate_privilege = estate_nobles_land_rights 
					}
					if = {
						limit = { has_estate = estate_church } 
						has_estate_privilege = estate_church_land_rights 
					}
					if = {
						limit = { has_estate = estate_nomadic_tribes } 
						has_estate_privilege = estate_nomadic_tribes_land_rights
					}
				}
				AND = {
					empire_of_china_has_active_decree = conduct_census_decree
					if = {
						limit = { has_estate = estate_eunuchs } 
						estate_loyalty = {
							estate = estate_eunuchs
							loyalty = 60 
						}
					}
					if = {
						limit = { has_estate = estate_burghers } 
						estate_loyalty = {
							estate = estate_burghers
							loyalty = 60 
						}
					}
					if = {
						limit = { has_estate = estate_nobles } 
						estate_loyalty = {
							estate = estate_nobles
							loyalty = 60 
						}
					}
					if = {
						limit = { has_estate = estate_church } 
						estate_loyalty = {
							estate = estate_church
							loyalty = 60 
						}
					}
					if = {
						limit = { has_estate = estate_nomadic_tribes } 
						estate_loyalty = {
							estate = estate_nomadic_tribes
							loyalty = 60 
						}
					}
					government_reform_progress = 150 
				}
			}
		}
		
		effect = {
			custom_tooltip = mng_estates_govcap_now_grants_another_50_gov_cap_tt
			tooltip = {
				add_ruler_modifier = {
					name = mng_cabinet_cooperation_modifier
					duration = -1 
				}
			}
			
			custom_tooltip = mng_alternatively_pop_census_improved
			tooltip = {
				if = {
					limit = { 
						has_dlc = "Rights of Man" 
						NOT = { num_of_ruler_traits = { amount = 3 } }
					}
					change_government_reform_progress = -150 
					add_ruler_personality = reformist_personality
				}
				else = { change_government_reform_progress = -100 }
			}
			
			hidden_effect = {
				if = {
					limit = {
						has_estate_privilege = estate_burghers_land_rights
						has_estate_privilege = estate_eunuchs_land_rights_privilege
						has_estate_privilege = estate_church_land_rights
						has_estate_privilege = estate_nobles_land_rights 
					}
					set_country_flag = mng_increased_land_rights_flag 
					add_ruler_modifier = {
						name = mng_cabinet_cooperation_modifier
						duration = -1 
					}
				}
				else_if = {
					limit = { 
						has_dlc = "Rights of Man" 
						has_dlc = "Mandate of Heaven" 
						NOT = { num_of_ruler_traits = { amount = 3 } }
					}
					change_government_reform_progress = -150 
					add_ruler_personality = reformist_personality
					set_country_flag = mng_empowered_pop_census_flag 
				}
				else = { 
					change_adm = 1 
					change_government_reform_progress = -100 
					set_country_flag = mng_empowered_pop_census_flag 
				}
			}
		}
	}
	
	mng_examination_system2 = {
		icon = mission_vedic_education 
		required_missions = { mng_cornerstone_empire2 mng_reform_civil_registration2 }
		position = 10

		provinces_to_highlight = {
			province_id = 700 
			NOT = { owned_by = ROOT }
		}
		
		trigger = {
			OR = {
				has_reform = examination_system_reform
				government_reform_progress = 250 
			}
			crown_land_share = 45 
			stability = 3 
			700 = { owned_by = ROOT }
		}
		
		effect = {
			custom_tooltip = mng_exam_system_reward_tt
			tooltip = { 
				country_event = { id = flavor_mng.30 } 
			}
			custom_tooltip = mng_insight_30_tt
			
			custom_tooltip = pol_alternatively_tt
			tooltip = {
				define_advisor = {
					type = natural_scientist
					cost_multiplier = 0.33 
					skill = 2
				}
				define_advisor = {
					type = trader
					cost_multiplier = 0.33
					skill = 2
				}
				define_advisor = {
					type = quartermaster
					cost_multiplier = 0.33
					skill = 2
				}
			}
			hidden_effect = {
				if = {	
					limit = { has_reform = examination_system_reform }
					country_event = { id = flavor_mng.30 }
				}
				else = { 
					define_advisor = {
						type = natural_scientist
						cost_multiplier = 0.33 
						skill = 2
					}
					define_advisor = {
						type = trader
						cost_multiplier = 0.33
						skill = 2
					}
					define_advisor = {
						type = quartermaster
						cost_multiplier = 0.33
						skill = 2
					}
				}
			}
		}
	}
	
	mng_mutual_trade_system2 = {
		icon = mission_diplomatic_relation 
		required_missions = { mng_censorate2 mng_examination_system2 }
		position = 12
		
		trigger = {
			OR = {
				calc_true_if = {
					all_subject_country = {
						is_subject_of_type_with_overlord = { who = ROOT type = tributary_state }
						NOT = { liberty_desire = 10 } 
						has_opinion = { 
							who = ROOT 
							value = 120 
						}
					}
					desc = mng_5_tribs_with_opinion_and_lib_desire_tt
					amount = 5
				}
				calc_true_if = {
					all_ally = {
						has_opinion = {
							who = ROOT 
							value = 150 
						}
						if = {
							limit = { has_dlc = "Leviathan" }
							trust = {
								who = ROOT 
								value = 70 
							}
						}
					}
					amount = 4 
				}
			}
			government_reform_progress = 150 
		}
		
		effect = { 
			custom_tooltip = mng_ally_reward_tt
			tooltip = {
				add_country_modifier = {
					name = mng_trade_access_in_china_modifier
					duration = -1 
					desc = as_long_as_we_stay_allies_desc
				}
			}
			
			if = { 
				limit = {
					has_dlc = "Mandate of Heaven" 
					is_emperor_of_china = yes 
				}
				custom_tooltip = mng_5_mandate_per_ally_tt
			}
			else = { custom_tooltip = mng_25_mp_per_ally_tt } 
			tooltip = {
				add_country_modifier = {
					name = mng_foreign_merchant_influx_modifier
					duration = 7300 
				}
			}
			
			custom_tooltip = mng_trib_reward_tt
			tooltip = { 
				country_event = { id = flavor_mng.31 }
			}
			custom_tooltip = mng_insight_31_tt
			hidden_effect = {
				if = {
					limit = { 
						calc_true_if = {
							all_ally = {
								has_opinion = {
									who = ROOT 
									value = 150 
								}
								if = {
									limit = { has_dlc = "Leviathan" }
									trust = {
										who = ROOT 
										value = 70 
									}
								}
							}
							amount = 4 
						}
					}
					every_ally = { 
						limit = { 
							has_opinion = {
								who = ROOT 
								value = 150 
							}
							if = {
								limit = { has_dlc = "Leviathan" }
								trust = {
									who = ROOT 
									value = 70 
								}
							}
						}
						add_country_modifier = {
							name = mng_trade_access_in_china_modifier
							duration = -1 
							desc = as_long_as_we_stay_allies_desc
						}
					}
					add_country_modifier = {
						name = mng_foreign_merchant_influx_modifier
						duration = 7300 
					}
					if = {
						limit = { has_dlc = "Mandate of Heaven" } 
						every_ally = { 
							limit = { 
								has_opinion = {
									who = ROOT 
									value = 150 
								}
								if = {
									limit = { has_dlc = "Leviathan" }
									trust = {
										who = ROOT 
										value = 70 
									}
								}
							}
							ROOT = { add_mandate = 5 } 
						}
					}
					else = { 
						every_ally = { 
							limit = { 
								has_opinion = {
									who = ROOT 
									value = 150 
								}
								if = {
									limit = { has_dlc = "Leviathan" }
									trust = {
										who = ROOT 
										value = 70 
									}
								}
							}
							ROOT = { 
								add_adm_power = 25 
								add_dip_power = 25 
								add_mil_power = 25 
							}
						}
					}
				}
				else = { 
					country_event = { id = flavor_mng.31 }
				}
			}
		}
	}
}

DOM_japanse_missions_3_a = {
	slot = 3
	generic = no
	ai = yes
	potential_on_load = {
		has_dlc = "Domination" 
	}
	potential = {
		tag = JAP 
		has_dlc = "Domination" 
		NOT = { map_setup = map_setup_random }
	}
	has_country_shield = yes
	
	jap_issue_new_coin = {
		icon = mission_high_income
		required_missions = {  }
		position = 1
		trigger = {
			share_of_starting_income = 2.0
			is_in_deficit = no
			if = {
				limit = { ai = no }
				OR = {
					economic_ideas = 1
					monthly_adm = 10 
					national_focus = ADM 
				}
			}
			NOT = { num_of_loans = 1 } 
			owns_core_province = 1024
		}
		effect = {
			add_country_modifier = {
				name = jap_balancing_koban_and_ryo_modifier
				duration = 7300
			}
			
			if = { 
				limit = { 
					1024 = { base_production = 8 NOT = { trade_goods = gold } }
				}
				1024 = { change_trade_goods = gold }
			}
			else_if = {
				limit = { 
					1024 = {
						NOT = { trade_goods = gold } 
					}
				}
				custom_tooltip = jap_gold_4182_tt
				tooltip = {
					1024 = { change_trade_goods = gold }
				}
			}
		}
	}
	
	jap_permit_ryogaesho = {
		icon = mission_jawal_silver_mine
		required_missions = { jap_issue_new_coin }
		position = 2
		trigger = {
			NOT = { inflation = 0.1 } 
			years_of_income = 2 
			OR = { 
				full_idea_group = economic_ideas 
				monthly_adm = 12 
				AND = {
					estate_influence = {
						estate = estate_burghers 
						influence = 75 
					}
					num_of_estate_agendas_completed = {
						estate = estate_burghers 
						value = 4
					}
					has_estate_privilege = estate_burghers_indebted_to_burghers
					is_in_deficit = no 
				}
			}
		}
		effect = {
			add_country_modifier = {
				name = growing_economy
				duration = 9125
			}
			
			custom_tooltip = jap_ginza_districts_tt
			tooltip = {
				japan_region = {
					limit = { country_or_non_sovereign_subject_holds = ROOT } 
					add_province_modifier = {
						name = jap_ginza_districts_modifier 
						duration = 7300
					}
				}
			}
			hidden_effect = {
				japan_region = {
					limit = { country_or_non_sovereign_subject_holds = ROOT } 
					add_province_modifier = {
						name = jap_ginza_districts_modifier 
						duration = 7300
					}
				}
			}
		}
	}
	
	jap_survey_secret_fields = {
		icon = mission_rice_field
		required_missions = { jap_five_regent_houses jap_permit_ryogaesho }
		position = 3
		provinces_to_highlight = {
			owned_by = ROOT 
			trade_goods = grain 
			has_manufactory_trigger = no
			num_free_building_slots = 1 
		}
		trigger = {
			NOT = { corruption = 0.1 } 
			num_of_owned_provinces_with = {
				region = japan_region 
				trade_goods = grain 
				has_manufactory_trigger = yes 
				value = 5 
			}
			OR = { 
				has_global_modifier_value = {
					which = global_tax_modifier 
					value = 0.2
				}
				treasurer = 3 
			}
		}
		effect = {
			add_country_modifier = {
				name = JAP_cadastral_surveys
				duration = 7300
			}
			custom_tooltip = jap_increase_base_tax_grants_more_crown_land_tt
		}
	}
	
	jap_encourage_fudasashi = {
		icon = jap_encourage_fudasashi
		required_missions = { jap_survey_secret_fields }
		position = 4
		trigger = {
			OR = { 
				estate_loyalty = {
					estate = estate_burghers 
					loyalty = 70 
				}
				adm = 5 
			}
			total_base_tax = 350
		}
		effect = {
			custom_tooltip = jap_20_years_devving_tax_yields_twice_bonus_1_burgher_loyalt_tt
			hidden_effect = {
				add_country_modifier = {
					name = jap_20_years_devving_tax_yields_twice_bonus_1_burgher_loyalt_modifier
					duration = 7300
					hidden = yes 
				}
			}
		}
	}
	
	jap_discover_new_world = {
		icon = mission_look_west
		required_missions = {  }
		position = 5
		trigger = {
			num_of_colonists = 1 
			num_of_light_ship = 20
		}
		effect = {
			add_country_modifier = {
				name = jap_new_world_exploration_modifier
				duration = 7300
			}
			create_explorer = { tradition = 60 }
		}
	}
	
	jap_conquer_north_china = {
		icon = jap_conquer_north_china
		required_missions = {  }
		position = 6
		provinces_to_highlight = {
			region = north_china_region 
			NOT = { country_or_non_sovereign_subject_holds = ROOT }
		}
		trigger = {
			num_of_provinces_owned_or_owned_by_non_sovereign_subjects_with = {
				region = north_china_region 
				value = 25 
			}
			if = {
				limit = { is_emperor_of_china = yes } 
				1816 = { owned_by = ROOT } 
			}
		}
		effect = {
			add_country_modifier = {
				name = jap_commercialization_of_mineral_resources_modifier
				duration = 7300 
			}
			
			change_price = {
				trade_goods = iron
				key = chinese_iron_key
				value = 0.25
				duration = 7300
			}
			custom_tooltip = jap_every_owned_prov_with_iron_1_bp_tt
			hidden_effect = {
				every_owned_province = {
					limit = { 
						trade_goods = iron 
						has_manufactory_trigger = yes 
					}
					add_base_production = 1 
				}
			}
			
			if = {
				limit = { is_emperor_of_china = yes } 
				add_mandate = 25 
			}
			else = { 
				north_china_region = { limit = { country_or_non_sovereign_subject_holds = ROOT } add_local_autonomy = -10 } 
			}
		}
	}
	
	jap_new_buddha = {
		icon = mission_to_china
		required_missions = {  }
		position = 7
		trigger = {
			if = {
				limit = { has_dlc = "Mandate of Heaven" religion = shinto }
				custom_trigger_tooltip = {
					tooltip = jap_had_spread_christianity_incident_tt
					OR = { 
						has_country_flag = a_kirishitan_realm 
						has_country_flag = significant_christian_presence_flag
						has_country_flag = christianity_defeated_flag
					}
				}
			}
			stability = 3 
			religious_unity = 0.9
		}
		effect = {
			tooltip = { swap_non_generic_missions = yes }
			if = { 
				limit = { has_dlc = "Mandate of Heaven" }
				custom_tooltip = a_kirishitan_realm_tt
				tooltip = { 
					override_country_name = KRJ
					add_country_modifier = {
						name = jap_protectors_east_catholicism
						duration = 10950 
					}
				}
			
				custom_tooltip = significant_christian_presence_tt
				tooltip = {
					set_estate_privilege = estate_church_japanese_christian_communities_privilege
				}
			
				custom_tooltip = christianity_defeated_tt
				tooltip = {
					add_country_modifier = {
						name = jap_shinto_warriors_modifier
						duration = -1 
					}
				}
			}
			
			else = {
				tooltip = {
					add_country_modifier = {
						name = jap_shinto_warriors_modifier
						duration = -1 
					}
				}
				set_country_flag = christianity_defeated_flag
			}
			
			hidden_effect = {
				if = {
					limit = { has_country_flag = a_kirishitan_realm }
					override_country_name = KRJ
					set_country_flag = is_KRJ_flag
					set_country_flag = has_overriden_name_flag
					add_country_modifier = {
						name = jap_protectors_east_catholicism
						duration = 10950 
					}
				}
				else_if = {
					limit = { has_country_flag = significant_christian_presence_flag }
					set_estate_privilege = estate_church_japanese_christian_communities_privilege
				}
				else = {
					add_country_modifier = {
						name = jap_shinto_warriors_modifier
						duration = -1 
					}
				}
				swap_non_generic_missions = yes
			}
		}
	}
}

DOM_japanse_missions_3_aa = {
	slot = 3
	generic = no
	ai = yes
	potential_on_load = {
		has_dlc = "Domination" 
	}
	potential = {
		tag = JAP 
		has_dlc = "Domination" 
		NOT = { map_setup = map_setup_random }
		has_dlc = "Mandate of Heaven"
		NOT = { has_country_flag = a_kirishitan_realm }
		NOT = { has_country_flag = christianity_defeated_flag }
		NOT = { has_country_flag = significant_christian_presence_flag }
	}
	has_country_shield = yes
	
	jap_shinto_or_christian = {
		icon = mission_locked_mission
		required_missions = { jap_new_buddha }
		position = 8
		provinces_to_highlight = {
			
		}
		trigger = {
			custom_trigger_tooltip = {
				tooltip = jap_shinto_mission_triggers_here
				always = no 
			}
			stability = 3 
			prestige = 90 
			NOT = { num_of_rebel_controlled_provinces = 1 }
			NOT = { average_autonomy_above_min = 5 } 
			is_at_war = no 
			OR = {
				absolutism = 100 
				AND = { 
					num_of_estate_privileges = {
						estate = estate_nobles 
						value = 6 
					}
					num_of_estate_privileges = {
						estate = estate_burghers 
						value = 6 
					}
					num_of_estate_privileges = {
						estate = estate_church 
						value = 6 
					}
				}
			}
			custom_trigger_tooltip = {
				tooltip = catholic_jap_mission_triggers_here
				always = no 
			}
			religion = catholic 
			OR = { 
				development_in_provinces = {
					value = 1000
					religion = catholic 
				}
				is_defender_of_faith = yes 
				is_great_power = yes 
				full_idea_group = religious_ideas
			}
		}
		effect = {
			custom_tooltip = jap_balance_power_reward_tt
			
			custom_tooltip = jap_catholic_supremacy_reward_tt
		}
	}
}

DOM_japanse_missions_3_b = {
	slot = 3
	generic = no
	ai = yes
	potential_on_load = {
		has_dlc = "Domination" 
	}
	potential = {
		tag = JAP 
		has_dlc = "Domination" 
		NOT = { map_setup = map_setup_random }
		NOT = { has_country_flag = a_kirishitan_realm }
		OR = {
			has_country_flag = significant_christian_presence_flag
			has_country_flag = christianity_defeated_flag 
		}
	}
	has_country_shield = yes
	
	jap_restoration = {
		icon = jap_restoration
		required_missions = { jap_new_buddha }
		position = 8
		trigger = {
			not_in_mission_preview_mode = { key = JAP_RELI }
			stability = 3 
			prestige = 90 
			NOT = { num_of_rebel_controlled_provinces = 1 }
			NOT = { average_autonomy_above_min = 5 } 
			is_at_war = no 
			OR = {
				absolutism = 100 
				AND = { 
					if = {
						limit = { has_estate = estate_nobles }
						num_of_estate_privileges = {
							estate = estate_nobles 
							value = 6 
						}
					}
					if = {
						limit = { has_estate = estate_burghers }
						num_of_estate_privileges = {
							estate = estate_burghers 
							value = 6 
						}
					}
					if = {
						limit = { has_estate = estate_church }
						num_of_estate_privileges = {
							estate = estate_church 
							value = 6 
						}
					}
				}
			}
		}
		effect = {
			custom_tooltip = jap_absolutism_shogun_reward_tt
			tooltip = {
				override_country_name = JPS
				add_government_reform = absolute_shogunate_reform
			}
			
			custom_tooltip = jap_estates_emperor_reward_tt
			tooltip = {
				override_country_name = JPE
				country_event = { id = flavor_jap.65 }
			}
			
			hidden_effect = {
				if = {
					limit = { 
						absolutism = 99 
						if = {
							limit = { has_estate = estate_nobles }
							NOT = {
								num_of_estate_privileges = {
									estate = estate_nobles 
									value = 6 
								}
							}
						}
						if = {
							limit = { has_estate = estate_burghers }
							NOT = {
								num_of_estate_privileges = {
									estate = estate_burghers 
									value = 6 
								}
							}
						}
						if = {
							limit = { has_estate = estate_church }
							NOT = {
								num_of_estate_privileges = {
									estate = estate_church 
									value = 6 
								}
							}
						}
					} 
					set_country_flag = has_overriden_name_flag
					override_country_name = JPS
					set_country_flag = is_JPS_flag
					add_government_reform = absolute_shogunate_reform
				}
				else = {
					override_country_name = JPE
					set_country_flag = is_JPE_flag
					set_country_flag = has_overriden_name_flag
					set_country_flag = JPE_gov_flag
					country_event = { id = flavor_jap.65 }
				}
			}	
		}
	}
}

DOM_japanse_missions_3_c = {
	slot = 3
	generic = no
	ai = yes
	potential_on_load = {
		has_dlc = "Domination" 
	}
	potential = {
		tag = JAP 
		has_dlc = "Domination" 
		NOT = { map_setup = map_setup_random }
		has_dlc = "Mandate of Heaven" 
		has_country_flag = a_kirishitan_realm
		NOT = { has_country_flag = christianity_defeated_flag }
	}
	has_country_shield = yes
	
	jap_spread_the_christian_faith = {
		icon = jap_kirishtan_realm
		required_missions = { jap_new_buddha }
		position = 8 
		provinces_to_highlight = {
			
		}
		trigger = {
			not_in_mission_preview_mode = { key = JAP_RELI }
			religion = catholic 
			OR = { 
				development_in_provinces = {
					value = 1000
					religion = catholic 
				}
				is_defender_of_faith = yes 
				is_great_power = yes 
				full_idea_group = religious_ideas
			}
		}
		effect = {
			if = {
				limit = {
					NOT = { government = monarchy }
				}
				change_government = monarchy
			}
			add_government_reform = land_christian_sun_reform
			
			custom_tooltip = jap_winning_battles_gains_papal_influence_tt
			set_country_flag = enable_pi_per_battle_won_flag
		}
	}
}

japanese_missions_eoc_3 = {
	slot = 3
	generic = no
	ai = yes
	potential = {
		has_dlc = "Domination"
		is_emperor_of_china = yes 
		tag = JAP 
	}
	has_country_shield = yes 
	
	mng_tame_china_sorrow2 = {
		icon = mng_tame_china_sorrow
		required_missions = { } 
		position = 9
		provinces_to_highlight = { 
			OR = {
				province_id = 2142
				province_id = 4196
				province_id = 2141
				province_id = 688
				province_id = 1836
			}
			OR = { 
				NOT = { controlled_by = ROOT }
				devastation = 1
				NOT = { num_of_times_improved = 3 } 
			}	
		}
		
		trigger = {
			2142 = { 
				num_of_times_improved = 3 
				owned_by = ROOT 
				if = {
					limit = { has_dlc = "Mandate of Heaven" }
					NOT = { devastation = 1 } 
				}
			}
			4196 = { 
				num_of_times_improved = 3 
				owned_by = ROOT 
				if = {
					limit = { has_dlc = "Mandate of Heaven" }
					NOT = { devastation = 1 } 
				}
			}
			2141 = { 
				num_of_times_improved = 3 
				owned_by = ROOT 
				if = {
					limit = { has_dlc = "Mandate of Heaven" }
					NOT = { devastation = 1 } 
				}
			}
			688 = { 
				num_of_times_improved = 3 
				owned_by = ROOT 
				if = {
					limit = { has_dlc = "Mandate of Heaven" }
					NOT = { devastation = 1 } 
				}
			}
			1836 = { 
				num_of_times_improved = 3 
				owned_by = ROOT 
				if = {
					limit = { has_dlc = "Mandate of Heaven" }
					NOT = { devastation = 1 } 
				}
			}
		}
		
		effect = { 
			country_event = { id = flavor_mng.35 }
			custom_tooltip = mng_insight_35_tt
		}
	}
	
	mng_single_whip_law2 = {
		icon = mission_african_gold 
		required_missions = { mng_examination_system2 }
		position = 11
		provinces_to_highlight = { 
			OR = {
				province_id = 2174 
				province_id = 2139 
			}
			NOT = { base_production = 12 }
		}
		
		trigger = {
			empire_of_china_reform_passed = reform_land_tax_decision
			2174 = { 
				owned_by = ROOT 
				base_production = 12 
			}
			2139 = { 
				owned_by = ROOT 
				base_production = 12 
			}
			NOT = { inflation = 1 }
			NOT = { num_of_loans = 1 } 
			current_income_balance = 35
			OR = {
				has_estate_privilege = estate_eunuchs_single_whip_law_privilege 
				government_reform_progress = 250 
			}
		}
		
		effect = {
			country_event = { id = flavor_mng.36 }
			custom_tooltip = mng_insight_36_tt
		}
	}
	
	mng_pure_land2 = {
		icon = mng_pure_land 
		required_missions = { }
		position = 12
		provinces_to_highlight = { 
			province_id = 2140 
			OR = {
				NOT = { has_tax_building_trigger = yes } 
				NOT = { num_of_times_improved = 5 } 
			}
		}
		
		trigger = {
			num_of_owned_provinces_with = {
				has_tax_building_trigger = yes 
				value = 15 
			}
			2140 = {
				num_of_times_improved = 5 
				has_tax_building_trigger = yes 
			}
			if = {
				limit = { 
					has_dlc = "Mandate of Heaven" 
					religion = confucianism 
				} 
				harmony = 90 
			}
			else_if = {
				limit = { has_estate = estate_church } 
				estate_loyalty = {
					estate = estate_church 
					loyalty = 65 
				}
			}
			else = { prestige = 40 } 
		}
		
		effect = {
			if = {
				limit = { 
					has_dlc = "Leviathan" 
					2140 = {
						NOT = { 
							has_great_project = {
								type = temple_of_confucius 
								tier = 3 
							}
						}
					}
				}
				2140 = {
					add_great_project_tier = {
						type = temple_of_confucius 
						tier = 1 
					}
				}
			}
			else = {
				2140 = {
					add_base_tax = 3 
					add_base_production = 3 
				}
			}
			2140 = { 
				add_building = cathedral 
				remove_building = temple 
			}
			add_stability_or_adm_power = yes 
		}
	}
	
	mng_shengshi_zhishi2 = {
		icon = mng_shengshi_zhishi 
		required_missions = { mng_mutual_trade_system2 mng_pure_land2 mng_expand_yongle_dadian2 }
		position = 13
		trigger = {
			if = {
				limit = { 
					has_dlc = "Mandate of Heaven" 
					is_emperor_of_china = yes 
				}
				empire_of_china_num_reforms_passed = 10
				imperial_mandate = 95 
			}
			else = { prestige = 90 } 
			NOT = { 
				num_of_estate_privileges = {	
					estate = estate_eunuchs 
					value = 1
				}
			}
			NOT = { 
				num_of_estate_privileges = {	
					estate = estate_nobles  
					value = 1 
				}
			}
			NOT = { 
				num_of_estate_privileges = {	
					estate = estate_burghers  
					value = 1 
				}
			}
			NOT = { 
				num_of_estate_privileges = {	
					estate = estate_church  
					value = 1 
				}
			}
			NOT = {
				estate_influence = {
					estate = estate_nobles 
					influence = 40 
				}
			}
			NOT = {
				estate_influence = {
					estate = estate_church 
					influence = 40 
				}
			}
			NOT = {
				estate_influence = {
					estate = estate_burghers  
					influence = 40 
				}
			}
			NOT = {
				estate_influence = {
					estate = estate_eunuchs  
					influence = 40 
				}
			}
			monthly_adm = 12 
			NOT = { num_of_loans = 1 } 
			OR = { 
				in_golden_age = yes  
				monthly_income = 500 
			}
		}
		
		effect = {
			custom_tooltip = mng_passing_reform_grants_10_estate_loyalty_tt
			add_power_projection = {
				type = 25_permanent_power_projection
				amount = 25
			}
			custom_tooltip = zim_amongst_the_great_powers_tt 
			add_country_modifier = { 
				name = mng_prosperous_era_modifier
				duration = -1 
			}
			if = { 
				limit = { has_dlc = "Mandate of Heaven" }
				if = {
					limit = { has_had_golden_age = yes } 
					reset_golden_age = yes 
				}
				else_if = {
					limit = { in_golden_age = yes } 
					extend_golden_age = 240
				}
			}
			set_country_flag = mng_shengshi_reward_flag 
			add_country_modifier = {
				name = mng_well_governed_era_modifier 
				duration = 9125 
			}
			change_ruler_stat = {
				type = adm
				amount = 1
			}
			change_ruler_stat = {
				type = dip
				amount = 1
			}
			change_ruler_stat = {
				type = mil
				amount = 1
			}
		}
	}	
}

DOM_japanse_missions_4_a = {
	slot = 4
	generic = no
	ai = yes
	potential_on_load = {
		has_dlc = "Domination" 
	}
	potential = {
		tag = JAP 
		has_dlc = "Domination" 
		NOT = { map_setup = map_setup_random }
		NOT = { has_country_flag = jap_mushashi_5_books_flag } 
		NOT = { has_country_flag = jap_domineering_naval_focus_flag }
	}
	has_country_shield = yes
	
	jap_bugeijuuhappan_or_naval_academy_of_japan = {
		icon = mission_locked_mission
		required_missions = { jap_bushido_code }
		position = 2
		trigger = {
			custom_trigger_tooltip = {
				tooltip = jap_bugeijuuhappan_requirements_tt
				always = no 
			}
			OR = {
				army_tradition = 85 
				army_professionalism = 0.8 
			}
			OR = { 
				has_global_modifier_value = {
					which = discipline 
					value = 0.15
				}
				has_global_modifier_value = {
					which = infantry_power 
					value = 0.2
				}
			}
			num_of_infantry = 35 # modified
			has_commanding_three_star = yes 
			army_reformer = 3 
			###############################
			custom_trigger_tooltip = {
				tooltip = jap_naval_academy_japan_requirements_tt
				always = no 
			}
			if = { 
				limit = { has_dlc = "Rule Britannia" } 
				has_naval_doctrine = any 
			}
			else = { naval_reformer = 3 } 
			num_of_admirals = 3 
			navy_tradition = 70
			OR = { 
				num_of_marines = 35
				AND = {
					num_of_heavy_ship = 50
					sailors = 75000
				}
			}
		}
		effect = {
			custom_tooltip = jap_replace_mushashi_with_bugeijuuhappan_tt
			tooltip = {
				remove_country_modifier = jap_mushashi_5_books_modifier 
				add_country_modifier = {
					name = jap_eighteen_arts_modifier
					duration = -1 
				}
			}
			
			custom_tooltip = jap_replace_naval_focus_with_academy_jap_tt
			tooltip = {
				remove_country_modifier = jap_domineering_naval_focus_modifier
				add_country_modifier = {
					name = jap_naval_academy_of_japan_modifier
					duration = -1 
				}
			}
		}
	}
}

DOM_japanse_missions_4_b = {
	slot = 4
	generic = no
	ai = yes
	potential_on_load = {
		has_dlc = "Domination" 
	}
	potential = {
		tag = JAP 
		has_dlc = "Domination" 
		NOT = { map_setup = map_setup_random }
		has_country_flag = jap_mushashi_5_books_flag 
		NOT = { has_country_flag = jap_domineering_naval_focus_flag }
	}
	has_country_shield = yes
	
	jap_bugeijuuhappan = {
		icon = jap_bugeijuuhappan
		required_missions = { jap_bushido_code }
		position = 2
		trigger = {
			not_in_mission_preview_mode = { key = JAP }
			OR = {
				army_tradition = 85 
				army_professionalism = 0.8 
			}
			OR = { 
				has_global_modifier_value = {
					which = discipline 
					value = 0.15
				}
				has_global_modifier_value = {
					which = infantry_power 
					value = 0.2
				}
			}
			num_of_infantry = 35 # modified
			has_commanding_three_star = yes 
			army_reformer = 3 
		}
		effect = {
			remove_country_modifier = jap_mushashi_5_books_modifier
			add_country_modifier = {
				name = jap_eighteen_arts_modifier
				duration = -1 
			}
		}
	}
}

DOM_japanse_missions_4_c = {
	slot = 4
	generic = no
	ai = yes
	potential_on_load = {
		has_dlc = "Domination" 
	}
	potential = {
		tag = JAP 
		has_dlc = "Domination" 
		NOT = { map_setup = map_setup_random }
		NOT = { has_country_flag = jap_mushashi_5_books_flag }
		has_country_flag = jap_domineering_naval_focus_flag 
	}
	has_country_shield = yes
	
	jap_naval_academy_of_japan = {
		icon = mission_establish_high_seas_navy
		required_missions = { jap_bushido_code }
		position = 2
		trigger = {
			not_in_mission_preview_mode = { key = JAP }
			if = { 
				limit = { has_dlc = "Rule Britannia" } 
				has_naval_doctrine = any 
			}
			else = { naval_reformer = 3 } 
			num_of_admirals = 3 
			navy_tradition = 70
			OR = { 
				num_of_marines = 35
				AND = {
					num_of_heavy_ship = 50
					sailors = 75000
				}
			}
		}
		effect = {
			remove_country_modifier = jap_domineering_naval_focus_modifier
			add_country_modifier = {
				name = jap_naval_academy_of_japan_modifier
				duration = -1 
			}
		}
	}
}

DOM_japanse_missions_4_d = {
	slot = 4
	generic = no
	ai = yes
	potential_on_load = {
		has_dlc = "Domination" 
	}
	potential = {
		tag = JAP 
		has_dlc = "Domination" 
		NOT = { map_setup = map_setup_random }
	}
	has_country_shield = yes
	
	jap_strengthen_bakuhan_system = {
		icon = jap_strengthen_bakuhan_system
		required_missions = { jap_survey_secret_fields jap_proliferation_firearms }
		position = 4
		provinces_to_highlight = {
			province_id = 1028 
			OR = {
				development = 45 
				NOT = { 
					has_great_project = {
						type = sankin_kotai_palaces
						tier = 3 
					}
				}
			}
		}
		trigger = {
			absolutism = 50 
			crown_land_share = 90 
			if = {
				limit = { has_dlc = "Leviathan" } 
				1028 = {
					has_great_project = {
						type = sankin_kotai_palaces
						tier = 3 
					}
				}
			}
			else = { 1028 = { development = 45 } }
			reform_level = 10
		}
		effect = {
			add_government_reform = strengthen_bakuhan_system_reform
		}
	}
	
	jap_deploy_atakebune = {
		icon = jap_deploy_atakebune
		required_missions = { }
		position = 5
		trigger = {
			heavy_ship_fraction = 0.1
			OR = { 
				navy_tradition = 50
				num_of_heavy_ship = 10 
			}
			navy_size_percentage = 0.9
		}
		effect = {
			add_country_modifier = {
				name = jap_tekkosen_modifier
				duration = 7300
			}
			add_navy_tradition = 10 
			if = {
				limit = { full_idea_group = naval_ideas has_dlc = "Golden Century" }
				random_owned_province = {
					limit = { has_port = yes } 
					create_flagship = {
						name = "O-Atakebune" 
						type = heavy_ship 
					}
				}
			}
			else_if = { 
				limit = { has_dlc = "Golden Century" } 
				custom_tooltip = jap_flagship_if_naval_ideas_tt
			}
		}
	}
	
	jap_surpass_the_west = {
		icon = mission_raid_christian_trade
		required_missions = { jap_deploy_atakebune jap_conquer_north_china }
		position = 7
		provinces_to_highlight = {
			
		}
		trigger = {
			custom_trigger_tooltip = {
				tooltip = japan_has_encountered_the_west_tooltip
				has_global_flag = japan_has_encountered_the_west
			}
			custom_trigger_tooltip = {
				tooltip = jap_any_western_nation_stronger_navy_tt
				NOT = {
					any_country = {
						NOT = { technology_group = western }
						navy_size = ROOT 
					}
				}
			}
			OR = { 
				full_idea_group = naval_ideas 
				full_idea_group = maritime_ideas 
			}
		}
		effect = {
			if = {
				limit = { has_dlc = "Emperor" is_hegemon = no }
				custom_tooltip = jap_gain_access_to_naval_hegemon_tt
				set_country_flag = jap_halve_naval_hegemony_requirements
			}
			else = {
				add_country_modifier = {
					name = jap_shogoki_modifier
					duration = -1 
				}
			}
		}
	}
}

japanese_missions_eoc_4 = {
	slot = 4
	generic = no
	ai = yes
	potential = {
		has_dlc = "Domination"
		is_emperor_of_china = yes 
		tag = JAP 
	}
	has_country_shield = yes 	
	
	mng_expand_bogue2 = {
		icon = mng_expand_bogue 
		required_missions = {  } 
		position = 9
		provinces_to_highlight = { 
			province_id = 667 
			NOT = { num_of_times_improved = 4 } 
			OR = {
				num_of_times_expanded_infrastructure = 1 
				has_trade_building_trigger = no 
			}
		} 
		
		trigger = { 
			667 = {
				num_of_times_improved = 4 
				OR = {
					num_of_times_expanded_infrastructure = 1 
					has_trade_building_trigger = yes 
				}
			}
			if = { 
				limit = { has_estate = estate_burghers }
				estate_loyalty = {
					estate = estate_burghers 
					loyalty = 60 
				}
			}
		}
		
		effect = {
			custom_tooltip = mng_pearly_estuary_upgraded_tt
			hidden_effect = {
				667 = {
					remove_province_modifier = pearl_estuary_modifier
					add_province_modifier = {
						name = mng_bogue_modifier 
						duration = -1 
					}
				}
				if = { 
					limit = { has_dlc = "Leviathan" }
					custom_tooltip = mng_10_loyalty_for_burghers_on_expand_infr_tt
					set_country_flag = mng_10_loyalty_for_burghers_on_expand_infr_flag
				}
				else = { add_adm_power = 100 }
			}
		}
	}
	
	mng_jing_hang_grand_canal2 = {
		icon = mng_jing_hang_grand_canal 
		required_missions = { mng_tame_china_sorrow2 mng_expand_bogue2 } 
		position = 10
		provinces_to_highlight = { 
			OR = { 
				province_id = 684 
				province_id = 1822 
				province_id = 2145 
				province_id = 1821
			}
			OR = { 
				NOT = { num_of_buildings_in_province = 3 }
				has_production_building_trigger = no 
				NOT = { num_of_times_expanded_infrastructure = 1 }
			}
		}
		
		trigger = {
			if = { 
				limit = { has_dlc = "Leviathan" }
				684 = {
					OR = { 
						has_great_project = {
							type = grand_canal_1
							tier = 2 
						}
						AND = {
							num_of_buildings_in_province = 3
							has_production_building_trigger = yes 
							num_of_times_expanded_infrastructure = 1 
						}
					}
				}
			}
			else = { 
				684 = { num_of_times_improved = 5 }
			} 
			if = {
				limit = { has_dlc = "Mandate of Heaven" }
				684 = {
					NOT = { devastation = 1 } 
				}
			}
			else = { 
				684 = {
					NOT = { local_autonomy_above_min = 5 } 
				}
			}
			if = { 
				limit = { has_dlc = "Leviathan" }
				1822 = { 
					OR = { 
						has_great_project = {
							type = grand_canal_2
							tier = 2 
						}
						AND = {
							num_of_buildings_in_province = 3
							has_production_building_trigger = yes 
							num_of_times_expanded_infrastructure = 1 
						}
					}
				}
			}
			else = { 
				1822 = { num_of_times_improved = 5 }
			} 
			if = {
				limit = { has_dlc = "Mandate of Heaven" }
				1822 = {
					NOT = { devastation = 1 } 
				}
			}
			else = { 
				1822 = {
					NOT = { local_autonomy_above_min = 5 } 
				}
			}
			if = { 
				limit = { has_dlc = "Leviathan" }
				2145 = { 
					OR = { 
						has_great_project = {
							type = grand_canal_3
							tier = 2 
						}
						AND = {
							num_of_buildings_in_province = 3
							has_production_building_trigger = yes 
							num_of_times_expanded_infrastructure = 1 
						}
					}
				}
			}
			else = { 
				2145 = { num_of_times_improved = 5 }
			} 
			if = {
				limit = { has_dlc = "Mandate of Heaven" }
				2145 = {
					NOT = { devastation = 1 } 
				}
			}
			else = { 
				2145 = {
					NOT = { local_autonomy_above_min = 5 } 
				}
			}
			if = { 
				limit = { has_dlc = "Leviathan" }
				1821 = { 
					OR = { 
						has_great_project = {
							type = grand_canal_4
							tier = 2 
						}
						AND = {
							num_of_buildings_in_province = 3
							has_production_building_trigger = yes 
							num_of_times_expanded_infrastructure = 1 
						}
					}
				}
			}
			else = { 
				1821 = { num_of_times_improved = 5 }
			} 
			if = {
				limit = { has_dlc = "Mandate of Heaven" }
				1821 = {
					NOT = { devastation = 1 } 
				}
			}
			else = { 
				1821 = {
					NOT = { local_autonomy_above_min = 5 } 
				}
			}
		}
		
		effect = { 
			country_event = { id = flavor_mng.34 }
			custom_tooltip = mng_insight_34_tt 
		}
	}
	
	mng_expand_yongle_dadian2 = {
		icon = mng_expand_yongle_dadian 
		required_missions = { mng_single_whip_law2 mng_fortify_coast2  } 
		position = 12
		provinces_to_highlight = {
			owned_by = ROOT 
			trade_goods = paper 
			OR = {
				NOT = { base_production = 10 }
				has_production_building_trigger = no
			}
		}
		
		trigger = {
			if = { 
				limit = { 
					has_dlc = "Mandate of Heaven" 
					is_emperor_of_china = yes 
				}
				imperial_mandate = 80 
			}
			else = { prestige = 40 }
			num_of_owned_provinces_with = { 
				trade_goods = paper 
				base_production = 10 
				has_production_building_trigger = yes 
				value = 4 
			}
			OR = { 
				if = { 
					limit = { has_dlc = "Rights of Man" }
					ruler_has_personality = free_thinker_personality 
				}
				else = { monthly_adm = 9 } 
				if = { 
					limit = { has_dlc = "Rights of Man" }
					ruler_has_personality = scholar_personality 
				}
				else = { has_adm_advisor_3 = yes }
				full_idea_group = innovativeness_ideas 
				has_institution = printing_press 
			}	
		}
		
		effect = {
			if = { 
				limit = { has_dlc = "Rule Britannia" }
				change_innovativeness = 5 
			}
			else = { add_adm_power = 50 add_dip_power = 50 add_mil_power = 50 } 
			
			custom_tooltip = mng_every_province_requirements_tt
			tooltip = { 
				add_province_modifier = { 
					name = mng_imperial_printing_center_modifier
					duration = -1 
				}
			}
			
			if = {
				limit = { 
					NOT = { is_institution_enabled = printing_press } 
				}
				custom_tooltip = mng_before_printing_press_embraced_tt
				hidden_effect = { 
					every_owned_province = { 
						limit = {
							trade_goods = paper 
							base_production = 10 
							has_production_building_trigger = yes 
						}
						add_institution_embracement = {
							which = printing_press 
							value = 100 
						}
					}
				}
			}
			hidden_effect = {
				every_owned_province = { 
					limit = {
						trade_goods = paper 
						base_production = 10 
						has_production_building_trigger = yes 
					}
					add_province_modifier = { 
						name = mng_imperial_printing_center_modifier
						duration = -1 
					}
				}
			}
		}
	}
}

DOM_japanse_missions_5 = {
	slot = 5
	generic = no
	ai = yes
	potential_on_load = {
		has_dlc = "Domination" 
	}
	potential = {
		tag = JAP 
		has_dlc = "Domination" 
		NOT = { map_setup = map_setup_random }
	}
	has_country_shield = yes
	
	jap_bushido_code = {
		icon = mission_japanese_samurai
		required_missions = { }
		position = 1
		trigger = {
			NOT = { corruption = 0.1 } 
			if = {
				limit = { ai = no }
				OR = { 
					army_professionalism = 0.2 
					army_tradition = 60 
				}
			}
			else = {
				OR = { 
					army_professionalism = 0.1 
					army_tradition = 40 
				}
			}
			if = { 
				limit = { current_age = age_of_discovery ai = no } 
				army_size = 15 # modified
			}
			else_if = {
				limit = { current_age = age_of_reformation ai = no } 
				army_size = 22 # modified
			}
			else_if = {
				limit = { current_age = age_of_absolutism ai = no } 
				army_size = 30 # modified
			}
			else = { army_size = 15 } # modified
		}
		effect = {
			country_event = { id = flavor_jap.66 } #Execute Order 66!
			custom_tooltip = jap_event_insight_66_tt
		}
	}
	
	jap_train_samurai = {
		icon = jap_train_samurai
		required_missions = { jap_bushido_code }
		position = 2
		trigger = {
			if = {
				limit = { ai = no }
				num_of_samurai = 20
			}
			else = { num_of_samurai = 10 }
			if = {
				limit = { 
					OR = {
						has_country_flag = jap_domineering_naval_focus_flag
						has_country_modifier = jap_naval_academy_of_japan_modifier
					}
				}
				navy_size = 75 # modified
				OR = { 
					num_of_marines = 20 
					full_idea_group = naval_ideas 
					full_idea_group = maritime_ideas 
				}
			}
			else = {
				has_completed_idea_group_of_category = { mil_ideas = yes } 
				army_tradition = 70 
			}
			reform_level = 5
		}
		effect = {
			custom_tooltip = jap_reform_samurai_tt
			tooltip = { add_government_reform = reform_the_samurai_reform }
			
			custom_tooltip = jap_marine_samurai_tt
			tooltip = { 
				if = { 
					limit = { 
						OR = { 
							has_dlc = "Lions of the North" 
							has_dlc = "Rule Britannia" 
							has_dlc = "Golden Century" 
						}
					}
					add_country_modifier = {
						name = jap_marine_samurai_modifier
						duration = -1 
					}
				}
				else = {
					add_country_modifier = {
						name = jap_marine_samurai_modifier2
						duration = -1 
					}
				}
			}
			hidden_effect = {
				if = { 
					limit = { 
						OR = {
							has_country_flag = jap_domineering_naval_focus_flag
							has_country_modifier = jap_naval_academy_of_japan_modifier
						}
						num_of_marines = 1 
					}
					add_country_modifier = {
						name = jap_marine_samurai_modifier
						duration = -1 
					}
				}
				else_if = { 
					limit = { 
						OR = {
							has_country_flag = jap_domineering_naval_focus_flag
							has_country_modifier = jap_naval_academy_of_japan_modifier
						}
					}
					add_country_modifier = {
						name = jap_marine_samurai_modifier2
						duration = -1 
					}
				}
				else = { add_government_reform = reform_the_samurai_reform }
			}
		}
	}
	
	jap_proliferation_firearms = {
		icon = mission_iron_and_copper
		required_missions = { jap_train_samurai }
		position = 3
		provinces_to_highlight = {
			OR = { 
				province_id = 1018
				province_id = 4184
				province_id = 4189
				province_id = 1012
				province_id = 4186
			}
			OR = { 
				trade_goods = copper 
				trade_goods = iron 
			}
			OR = {
				NOT = { num_of_times_improved = 5 }
				has_manufactory_trigger = no 
				NOT = { owned_by = ROOT }
			}
		}
		trigger = {
			if = { 
				limit = { 
					has_dlc = "Mandate of Heaven" 
					religion = shinto 
				}
				custom_trigger_tooltip = {
					tooltip = jap_had_boom_boom_pew_incident_tt
					OR = { 	
						has_country_flag = perfecting_the_musket_flag
						has_country_flag = proliferation_firearms_flag
						has_country_flag = example_of_bushido_flag
					}
				}
			}
			1018 = { 
				if = {
					limit = { 
						OR = { 
							trade_goods = iron 
							trade_goods = copper 
						}
					}
					owned_by = ROOT 
					has_manufactory_trigger = yes num_of_times_improved = 5 
				}
				else = { has_manpower_building_trigger = yes owned_by = ROOT }
			}
			4184 = { 
				if = {
					limit = { 
						OR = { 
							trade_goods = iron 
							trade_goods = copper 
						}
					}
					owned_by = ROOT 
					has_manufactory_trigger = yes num_of_times_improved = 5 
				}
				else = { has_manpower_building_trigger = yes owned_by = ROOT }
			}
			4186 = { 
				if = {
					limit = { 
						OR = { 
							trade_goods = iron 
							trade_goods = copper 
						}
					}
					owned_by = ROOT 
					has_manufactory_trigger = yes num_of_times_improved = 5 
				}
				else = { has_manpower_building_trigger = yes owned_by = ROOT }
			}
			4189 = { 
				if = {
					limit = { 
						OR = { 
							trade_goods = iron 
							trade_goods = copper 
						}
					}
					owned_by = ROOT 
					has_manufactory_trigger = yes num_of_times_improved = 5 
				}
				else = { has_manpower_building_trigger = yes owned_by = ROOT }
			}
			1012 = { 
				if = {
					limit = { 
						OR = { 
							trade_goods = iron 
							trade_goods = copper 
						}
					}
					owned_by = ROOT 
					has_manufactory_trigger = yes num_of_times_improved = 5 
				}
				else = { has_manpower_building_trigger = yes owned_by = ROOT }
			}
		}
		effect = {
			custom_tooltip = jap_perfecting_musket_tt
			tooltip = {
				add_country_modifier = {
					name = jap_thundering_firepower_modifier
					duration = 10950 
				}
			}
			
			custom_tooltip = jap_weapon_tool_tt
			
			custom_tooltip = jap_power_sword_tt
			tooltip = {
				add_country_modifier = {
					name = jap_unbreakable_spirit_modifier
					duration = 10950 
				}
			}
			
			custom_tooltip = pol_alternatively_tt
			tooltip = {
				add_country_modifier = {
					name = jap_advent_firearms_modifier
					duration = 10950
				}
			}
			
			hidden_effect = {
				if = { 
					limit = { has_country_flag = perfecting_the_musket_flag }
					add_country_modifier = {
						name = jap_thundering_firepower_modifier
						duration = 10950 
					}
				}
				else_if = {
					limit = { has_country_flag = proliferation_firearms_flag }
					every_owned_province = {
						limit = { region = japan_region } 
						add_province_modifier = {
							name = jap_firearm_production_modifier
							duration = 10950 
						}
					}
				}
				else_if = {
					limit = { has_country_flag = example_of_bushido_flag } 
					add_country_modifier = {
						name = jap_unbreakable_spirit_modifier
						duration = 10950 
					}
				}
				else = {
					add_country_modifier = {
						name = jap_advent_firearms_modifier
						duration = 10950
					}
				}
			}
		}
	}
	
	jap_tanegashima_teppo = {
		icon = mission_pol_develop_countryside
		required_missions = { jap_proliferation_firearms }
		position = 4
		provinces_to_highlight = {
			OR = { 
				province_id = 1018
				province_id = 4184
				province_id = 4189
			}
			OR = { 
				NOT = { base_production = 10 } 
				has_production_building_trigger = no 
				has_manufactory_trigger = no 
			}
		}
		trigger = {
			1018 = { 
				has_production_building_trigger = yes 
				has_manufactory_trigger = yes 
				base_production = 10
			}
			4184 = { 
				has_production_building_trigger = yes 
				has_manufactory_trigger = yes 
				base_production = 10
			}
			4189 = { 
				has_production_building_trigger = yes 
				has_manufactory_trigger = yes 
				base_production = 10
			}
		}
		effect = {
			if = {
				limit = { has_dlc = "Cradle of Civilization" }
				custom_tooltip = jap_army_buildings_grant_ap_tt
			}
			else = { 
				add_country_modifier = {
					name = jap_high_quality_weapons_modifier
					duration = 9125
				}
			}
			
			change_ruler_stat = {
				type = mil
				amount = 1
			} 
		}
	}
	
	jap_miyadaiku_method = {
		icon = jap_miyadaiku_method
		required_missions = { }
		position = 5
		trigger = {
			num_of_owned_provinces_with = {
				has_production_building_trigger = yes 
				value = 15 
			}
		}
		effect = {
			if = { 
				limit = { 
					has_dlc = "Mandate of Heaven" 
					religion = shinto 
				}
				custom_tooltip = jap_open_or_adaptive_tt
				tooltip = {
					add_country_modifier = {
						name = jap_trade_west_modifier
						duration = 7300
					}
				}
				
				custom_tooltip = jap_selective_integration_tt
				tooltip = {
					add_country_modifier = {
						name = jap_improved_engineering_expertise_modifier
						duration = 7300
					}
				}
				
				custom_tooltip = jap_isolationism_closed_doors_tt
				tooltip = {
					add_country_modifier = {
						name = jap_self_sufficient_market_modifier
						duration = 7300
					}
				}
				hidden_effect = {
					if = {
						limit = { 	
							NOT = { isolationism = 2 }
						}
						add_country_modifier = {
							name = jap_trade_west_modifier
							duration = 7300
						}
					}
					else_if = {
						limit = { 	
							NOT = { isolationism = 3 }
							isolationism = 2
						}
						add_country_modifier = {
							name = jap_improved_engineering_expertise_modifier
							duration = 7300
						}
					}
					else = {
						add_country_modifier = {
							name = jap_self_sufficient_market_modifier
							duration = 7300
						}
					}
				}
			}
			else = {
				add_country_modifier = {
					name = jap_self_sufficient_market_modifier
					duration = 7300
				}
			}
		}
	}
	
	jap_financial_cliques = {
		icon = jap_financial_cliques
		required_missions = { jap_miyadaiku_method }
		position = 6
		provinces_to_highlight = {
			region = japan_region 
			NOT = { base_production = 6 } 
		}
		trigger = {
			num_of_owned_provinces_with = {
				region = japan_region 
				has_manufactory_trigger = yes 
				value = 20 
			}
			OR = { 
				has_institution = manufactories
				japan_region = {
					type = all 
					base_production = 6
				}
			}
		}
		effect = {
			if = { 
				limit = { 
					has_dlc = "Mandate of Heaven" 
					religion = shinto 
				}
				custom_tooltip = jap_open_or_adaptive_tt
				tooltip = {
					add_country_modifier = {
						name = jap_overseas_ventures_modifier
						duration = 7300
					}
				}
				
				custom_tooltip = jap_selective_integration_tt
				tooltip = {
					add_country_modifier = {
						name = influx_of_foreign_knowledge_modifier
						duration = 7300
					}
				}
				
				custom_tooltip = jap_isolationism_closed_doors_tt
				tooltip = {
					add_country_modifier = {
						name = jap_internal_monopolies_modifier
						duration = 7300
					}
				}
				hidden_effect = {
					if = {
						limit = { 	
							NOT = { isolationism = 2 }
						}
						add_country_modifier = {
							name = jap_overseas_ventures_modifier
							duration = 7300
						}
					}
					else_if = {
						limit = { 	
							NOT = { isolationism = 3 }
							isolationism = 2
						}
						add_country_modifier = {
							name = influx_of_foreign_knowledge_modifier
							duration = 7300
						}
					}
					else = {
						add_country_modifier = {
							name = jap_internal_monopolies_modifier
							duration = 7300
						}
					}
				}
			}
			else = {
				add_country_modifier = {
					name = jap_internal_monopolies_modifier
					duration = 7300
				}
			}
		}
	}
	
	jap_japanese_economic_miracle = {
		icon = mission_war_chest
		required_missions = { jap_financial_cliques }
		position = 8
		trigger = {
			OR = {
				has_institution = industrialization
				is_hegemon_of_type = economic_hegemon
				monthly_income = 1000
			}
			development_in_provinces = {
				value = 900
				region = japan_region 
			}
		}
		effect = {
			if = { 
				limit = { 
					has_dlc = "Mandate of Heaven" 
					religion = shinto 
				}
				custom_tooltip = jap_open_or_adaptive_tt
				tooltip = {
					add_country_modifier = {
						name = jap_presence_global_markets
						duration = -1
					}
				}
				
				custom_tooltip = jap_selective_integration_tt
				tooltip = {
					add_country_modifier = {
						name = jap_mixed_commercial_policy_modifier
						duration = -1
					}
				}
				
				custom_tooltip = jap_isolationism_closed_doors_tt
				tooltip = {
					add_country_modifier = {
						name = jap_enforced_mercantilism_modifier
						duration = -1
					}
				}
				hidden_effect = {
					if = {
						limit = { 	
							NOT = { isolationism = 2 }
						}
						add_country_modifier = {
							name = jap_presence_global_markets
							duration = 7300
						}
					}
					else_if = {
						limit = { 	
							NOT = { isolationism = 3 }
							isolationism = 2
						}
						add_country_modifier = {
							name = jap_mixed_commercial_policy_modifier
							duration = 7300
						}
					}
					else = {
						add_country_modifier = {
							name = jap_enforced_mercantilism_modifier
							duration = 7300
						}
					}
				}
			}
			else = {
				add_country_modifier = {
					name = jap_enforced_mercantilism_modifier
					duration = 7300
				}
			}
		}
	}
}

japanese_missions_eoc_5 = {
	slot = 5
	generic = no
	ai = yes
	potential = {
		has_dlc = "Domination"
		is_emperor_of_china = yes 
		tag = JAP
		capital_scope = { continent = asia }
	}
	has_country_shield = yes 
	
	mng_form_depots2 = {
		icon = mng_form_depots 
		required_missions = {  } 
		position = 9
		provinces_to_highlight = {
			OR = { 
				province_id = 696 
				province_id = 4194
			}
		} 
		trigger = { 
			OR = { 
				spymaster = 1 
				ruler_has_personality = intricate_web_weaver_personality
				dip = 5 
				has_idea = efficient_spies
				national_focus = DIP 
			}
			OR = { 
				696 = { 
					development = 15 
					owned_by = ROOT 
				}
				4194 = {
					development = 15 
					owned_by = ROOT 
				}
			}
			if = { 
				limit = { has_estate = estate_eunuchs } 
				OR = {
					estate_loyalty = {
						estate = estate_eunuchs 
						loyalty = 60 
					}
					crown_land_share = 45
				}
			}
		}
		
		effect = {
			country_event = { id = flavor_mng.40 }
			custom_tooltip = mng_insight_40_tt
		}
	}
	
	mng_outer_city_beijing2 = {
		icon = mng_outer_city_beijing 
		required_missions = { mng_form_depots2 } 
		position = 10
		provinces_to_highlight = { 
			province_id = 1816 
			OR = { 
				has_tax_building_trigger = no 
				has_production_building_trigger = no 
				has_trade_building_trigger = no 
				has_manpower_building_trigger = no 
			}
		} 
		
		trigger = { 
			1816 = { development = 35 }
			1816 = { 
				has_tax_building_trigger = yes
				has_production_building_trigger = yes  
				has_trade_building_trigger = yes  
				has_manpower_building_trigger = yes 
			}
			1816 = { 
				OR = { 
					if = {
						limit = { has_dlc = "Mandate of Heaven" } 
						prosperity = 50 
					}
					if = { 
						limit = { has_dlc = "Leviathan" } 
						num_of_times_expanded_infrastructure = 1
					}
					else = { num_of_times_improved = 5 } 
				}
			}
		}
		
		effect = {	
			if = {
				limit = { 
					1816 = { has_manufactory_trigger = no } 
				}
				1816 = {
					add_province_modifier = {
						name = mng_outer_wall_beijing_modifier
						duration = -1 
						desc = until_it_is_conquered_desc
					}
				}
				custom_tooltip = mng_can_build_imperial_granary_tt
			}
			else = {
				1816 = {
					add_province_modifier = {
						name = mng_outer_wall_beijing_and_imperial_granary_modifier
						duration = -1
					}
				}
			}
		}
	}
	
	mng_fortify_coast2 = {
		icon = mission_portuguese_malacca 
		required_missions = { mng_outer_city_beijing2 mng_jing_hang_grand_canal2 } 
		position = 11
		provinces_to_highlight = { 
			owned_by = ROOT 
			AND = {
				has_port = yes 
				has_coast_defense_building_trigger = no 
				NOT = { development = 20 }
			}
		} 
		
		trigger = { 
			if = {
				limit = { has_dlc = "Mandate of Heaven" } 
				NOT = { 
					num_of_owned_provinces_with = {
						devastation = 1 
						value = 1 
					}
				}
			}
			num_of_owned_provinces_with = { 
				has_coast_defense_building_trigger = yes 
				development = 20 
				value = 8 
			}
			OR = { 
				num_of_galley = 50 
				num_of_light_ship = 50
			}
			OR = { 
				full_idea_group = trade_ideas 
				dip = 6 
				monthly_dip = 10 
				national_focus = DIP 
			}
		}
		
		effect = {
			custom_tooltip = mng_improve_haijin_policy_reward_tt
			tooltip = {
				if = {
					limit = { has_dlc = "Mandate of Heaven" }
					add_prosperity = 100 
					add_mandate = 5 
				}
				if = {
					limit = { has_dlc = "Mandate of Heaven" }
					add_mandate = 5 
				}
				else = { 
					add_base_production = 1 
					owner = { add_prestige_or_monarch_power = { amount = 35 } } 
				} 
				add_province_modifier = {
					name = mng_safe_coasts_modifier
					duration = 9125 
				}
			}
			
			custom_tooltip = mng_repeal_and_replace_reward_policy_tt
			tooltip = {
				define_advisor = {
					type = trader 
					cost_multiplier = 0.1 
				}
				if = { 
					limit = { 
						is_emperor_of_china = yes
						has_dlc = "Mandate of Heaven" 
					}
					add_mandate = 10 
				}
				else = { add_prestige_or_monarch_power = { amount = 35 } }
				change_government_reform_progress = 100 
			}
			
			hidden_effect = { 
				if = {
					limit = { mission_completed = mng_repeal_haijin_policy }
					define_advisor = {
						type = trader 
						cost_multiplier = 0.1 
					}
					if = { 
						limit = { 
							is_emperor_of_china = yes
							has_dlc = "Mandate of Heaven" 
						}
						add_mandate = 10 
					}
					else = { 
						add_prestige_or_monarch_power = { amount = 35 }
					}
					change_government_reform_progress = 100 
					set_country_flag = mng_trade_eff_per_dip_advisor_level_flag
				}
				else = {
					every_owned_province = {
						limit = {
							has_coast_defense_building_trigger = yes 
							development = 20 
						}
						add_province_modifier = {
							name = mng_safe_coasts_modifier
							duration = 9125 
						}
						if = {
							limit = { has_dlc = "Mandate of Heaven" }
							add_prosperity = 100 
						}
						else = { 
							add_base_production = 1 
						} 
					}
					set_country_flag = mng_dev_per_adm_advisor_level_flag
					if = {
						limit = { has_dlc = "Mandate of Heaven" }
						add_mandate = 5 
					}
					else = {
						add_prestige_or_monarch_power = { amount = 35 }
					}
				}
			}
		}
	}
}