pte_give_up_cultural_hegemony = {
	category = 6
	power_projection = no
	power_cost_base = 0.736
	prestige_base = 0.5
	ae_base = 0
	warscore_cost = {
		all_provinces = 0.0
		no_provinces = 50.0
		owner_keeps = 0.0
		conquered = 0.0
		returned_core = 0.0
		released_nation = 0.0
		cancelled_subject = 0.0
		concede_colonial_region = 0.0
	}
	warscore_cap = -1
	requires_demand_independence = yes
	is_make_subject = no
	requires_is_allowed = no

	is_visible = {
		FROM = {
			has_country_modifier = pte_culture_group_hegemony_modifier
			NOT = { is_variable_equal = { which = pte_culture_group_hegemony_var value = 0 } }
		}
		NOT = { culture_group = FROM }
	}
	is_allowed = {
		FROM = {
			any_owned_province = {
				culture_group = PREV
				custom_trigger_tooltip = {
					tooltip = PTE_PROVINCE_CONTROLLED_BY_OUR_SIDE
					controller = {
						OR = {
							is_in_war = {
								attacker_leader = ROOT
								defenders = FROM
								attackers = THIS
							}
							is_in_war = {
								attackers = FROM
								defender_leader = ROOT
								defenders = THIS
							}
						}
					}
				}
			}
		}
	}
	effect = {
		FROM = {
			remove_country_modifier = pte_culture_group_hegemony_modifier
			set_variable = { which = pte_culture_group_hegemony_var value = 0 }
			add_country_modifier = {
				name = pte_culture_group_hegemony_cooldown_modifier
				duration = 7300
				hidden = yes
			}
		}
		if = {
			limit = {
				NOT = { has_country_modifier = pte_culture_group_hegemony_modifier }
				is_variable_equal = { which = pte_culture_group_hegemony_var value = 0 }
			}
			clr_global_flag = pte_culture_group_hegemony_global_cooldown
			set_global_flag = pte_culture_group_hegemony_global_cooldown
			add_country_modifier = {
				name = pte_culture_group_hegemony_global_cooldown_ignore
				duration = 21
				hidden = yes
			}
		}
		pte_update_cultural_hegemony_targets = yes
	}
	ai_weight = {
		export_to_variable = {
			variable_name = ai_value
			value = 1
		}
		limit = {
			OR = {
				FROM = {
					OR = {
						NOT = {
							num_of_owned_provinces_with = {
								value = 5
								OR = {
									is_claim = ROOT
									is_core = ROOT
								}
							}
						}
						is_in_war = {
							participants = ROOT
							participants = FROM
							casus_belli = cb_humiliate_rotw
						}
						is_in_war = {
							defenders = ROOT
							attackers = FROM
							casus_belli = cb_pte_defend_rival_subject
						}
					}
					OR = {
						AND = {
							is_rival = FROM
							FROM = {
								has_cultural_union = yes
							}
						}
						AND = {
							FROM = {
								has_cultural_union = no
							}
							num_of_owned_provinces_with = {
								value = 5
								has_owner_accepted_culture = no
								culture = ROOT
							}
						}
						AND = {
							has_dlc = "Emperor"
							is_hegemon = yes
							NOT = {
								is_in_war = {
									attacker_leader = ROOT
									defender_leader = FROM
									casus_belli = cb_hegemon
								}
							}
						}
					}
				}
				AND = {
					calc_true_if = {
						all_country = {
							has_country_modifier = pte_culture_group_hegemony_modifier
							NOT = { is_variable_equal = { which = pte_culture_group_hegemony_var value = 0 } }
						}
						amount = 5
					}
					is_subject = no
					NOT = { has_country_modifier = pte_culture_group_hegemony_modifier }
					is_variable_equal = { which = pte_culture_group_hegemony_var value = 0 }
					stability = 2
					dominant_culture = new_variable:Root:primary_culture
					NOT = { has_country_modifier = pte_culture_group_hegemony_cooldown_modifier }
					NOT = {
						any_country = {
							has_country_modifier = pte_culture_group_hegemony_modifier
							NOT = { is_variable_equal = { which = pte_culture_group_hegemony_var value = 0 } }
							ROOT = { culture_group = PREV }
						}
					}
					development_in_provinces = {
						value = 200
						culture_group = ROOT
					}
					NOT = {
						any_country = {
							culture_group = ROOT
							is_subject = no
							OR = {
								variable_arithmetic_trigger = {
									export_to_variable = {
										which = their_dev
										value = trigger_value:total_development
									}
									export_to_variable = {
										which = our_dev
										value = trigger_value:total_development
										who = ROOT
									}
									multiply_variable = { which = their_dev value = 1.5 }
									check_variable = { which = their_dev which = our_dev }
								}
								variable_arithmetic_trigger = {
									export_to_variable = {
										which = their_army_size
										value = trigger_value:army_size
									}
									export_to_variable = {
										which = our_army_size
										value = trigger_value:army_size
										who = ROOT
									}
									multiply_variable = { which = their_army_size value = 1.5 }
									check_variable = { which = their_army_size which = our_army_size }
								}
							}
						}
					}
				}
			}
		}
	}
}