estate_church_land_rights = {
	icon = privilege_grant_autonomy
	land_share = 5
	max_absolutism = -5
	conditional_modifier = { trigger = { has_absolutism_reduction_for_estate_privileges = yes } modifier = { max_absolutism = 1 } }
	loyalty = 0.05
	influence = 0.05
	can_select = {
	}
	on_granted = {
	}
	modifier_by_land_ownership = {
		
	}
	penalties = {
	}
	conditional_modifier = {
		trigger = { has_country_flag = mng_increased_land_rights_flag }
		modifier = {
			stability_cost_modifier = -0.05
		}
	}
	benefits = {
		governing_capacity = 100
	}
	conditional_modifier = {
		trigger = { has_country_flag = ned_land_rights_buff_flag }
		modifier = {
			governing_capacity = 50
		}
	}
	conditional_modifier = {
		trigger = { has_government_mechanic = russian_modernization_mechanic }
		modifier = { monthly_russian_modernization = -0.03 }
	}
	#conditional_modifier = {
	#	trigger = { has_government_mechanic = ottoman_decadence_mechanic }
	#	modifier = { monthly_ottoman_decadence = 0.02 }
	#}
	ai_will_do = {
		factor = 5
		modifier = {
			factor = 1.4
			num_of_territories = 5
		}
		modifier = {
			factor = 1.5
			num_of_territories = 10
		}
		modifier = {
			factor = 1.5
			num_of_territories = 15
		}
		modifier = {
			factor = 0
			OR = {
				NOT = { crown_land_share = 25 }
				estate_influence = {
					estate = estate_church
					influence = 75
				}
			}
			NOT = { has_estate_privilege = estate_church_land_rights }
		}
		modifier = {
			factor = 0
			NOT = { governing_capacity_percentage = 0.5 }
		}
		modifier = {
			factor = 3
			OR = {
				AND = {
					governing_capacity_percentage = 0.9
					NOT = { has_estate_privilege = estate_church_land_rights }
				}
				#The trigger below should make sure that the AI actually keeps this privilege when enacting it early game
				AND = {
					governing_capacity_percentage = 0.6
					has_estate_privilege = estate_church_land_rights
				}
			}
		}
		modifier = {
			factor = 0.8
			OR = {
				NOT = { crown_land_share = 40 }
				AND = {
					is_absolutism_active = yes
					NOT = { crown_land_share = 60 }
				}
			}
			NOT = { has_estate_privilege = estate_church_land_rights }
		}
		modifier = {
			factor = 0.8
			OR = {
				NOT = { crown_land_share = 30 }
				AND = {
					is_absolutism_active = yes
					NOT = { crown_land_share = 50 }
				}
			}
			NOT = { has_estate_privilege = estate_church_land_rights }
		}
		modifier = {
			factor = 0.8
			is_absolutism_active = yes
		}
		modifier = {
			factor = 2
			governing_capacity_percentage = 0.9
		}
		modifier = {
			factor = 3
			governing_capacity_percentage = 1
		}
		modifier = {
			factor = 10
			governing_capacity_percentage = 1.2
		}
		modifier = {
			factor = 8
			NOT = { adm_tech = 12 }
			governing_capacity_percentage = 0.8
		}
		modifier = {
			factor = 5
			NOT = { adm_tech = 12 }
			NOT = { government_rank = 1 }
			governing_capacity_percentage = 0.65
		}
		#Tag specific convincement - after tech 17 (+250 governing capacity) it should not play a role anymore
		modifier = {
			factor = 1.25
			tag = MOS
			NOT = { adm_tech = 17 }
		}
		modifier = {
			factor = 1.25
			tag = RUS
			NOT = { adm_tech = 17 }
		}
		modifier = {
			factor = 1.25
			tag = TUR
			NOT = { adm_tech = 17 }
		}
		modifier = {
			factor = 1.25
			tag = MNG
			NOT = { adm_tech = 17 }
		}
		modifier = {
			factor = 1.25
			tag = FRA
			NOT = { adm_tech = 17 }
		}
		modifier = {
			factor = 1.25
			tag = SPA
			NOT = { adm_tech = 17 }
		}
		modifier = {
			factor = 1.25
			tag = PLC
			NOT = { adm_tech = 17 }
		}
		#Has already a similar privilege active
		modifier = {
			factor = 0.75
			has_estate_privilege = estate_brahmins_land_rights
		}
		modifier = {
			factor = 0.75
			has_estate_privilege = estate_nobles_land_rights
		}
		modifier = {
			factor = 0.75
			has_estate_privilege = estate_maratha_land_rights
		}
		modifier = {
			factor = 0.75
			has_estate_privilege = estate_burghers_land_rights
		}
		modifier = {
			factor = 0.75
			has_estate_privilege = estate_vaisyas_land_rights
		}
		modifier = {
			factor = 0.75
			has_estate_privilege = estate_cossacks_land_rights
		}
		modifier = {
			factor = 0.75
			has_estate_privilege = estate_nomadic_tribes_land_rights
		}
		modifier = {
			factor = 0.75
			has_estate_privilege = estate_dhimmi_land_rights
		}
		modifier = {
			factor = 0.75
			has_estate_privilege = estate_jains_land_rights
		}
		modifier = {
			factor = 0.75
			has_estate_privilege = estate_rajput_land_rights
		}
	}
}

estate_church_religious_state = {
	icon = privilege_admin_power
	land_share = 10
	max_absolutism = -5
	conditional_modifier = { trigger = { has_absolutism_reduction_for_estate_privileges = yes } modifier = { max_absolutism = 1 } }
	loyalty = -0.05
	can_select = {
		can_select_monarch_power_privilege = {
			estate = estate_church
			type = adm
		}
	}
	on_granted = {
	}
	penalties = {
	}
	benefits = {
		country_admin_power = 1
	}
	conditional_modifier = {
		trigger = { has_government_mechanic = russian_modernization_mechanic }
		modifier = { monthly_russian_modernization = -0.03 }
	}
	conditional_modifier = {
		trigger = { has_country_flag = BYZ_upgrade_the_religious_state_estate_privilege_flag }
		modifier = { stability_cost_modifier = -0.15 }
	}
	conditional_modifier = {
		trigger = { has_government_attribute = GER_upgrade_religious_state }
		modifier = {
			tolerance_own = 1
			religious_unity = 0.15
		}
	}
	ai_will_do = {
		factor = 100
		modifier = {
			factor = 0.5
			OR = {
				NOT = { crown_land_share = 25 }
				estate_influence = {
					estate = estate_church
					influence = 95
				}
			}
			NOT = { has_estate_privilege = estate_church_religious_state }
		}
		modifier = {
			factor = 0.8
			OR = {
				NOT = { crown_land_share = 35 }
				AND = {
					is_absolutism_active = yes
					NOT = { crown_land_share = 55 }
				}
			}
			NOT = { has_estate_privilege = estate_church_religious_state }
		}
		modifier = {
			factor = 0.8
			is_absolutism_active = yes
		}
		modifier = {
			factor = 1.25
			NOT = { adm = 2 }
		}
	}
}

estate_church_independent_inquisition = {
	icon = privilege_empty_throne
	max_absolutism = -5
	conditional_modifier = { trigger = { has_absolutism_reduction_for_estate_privileges = yes } modifier = { max_absolutism = 1 } }
	influence = 0.05
	loyalty = 0.05
	penalties = {
		stability_cost_modifier = 0.1
	}
	benefits = {
		adm_advisor_cost = -0.15
	}
	conditional_modifier = {
		trigger = { has_country_flag = hsn_appease_ulema_reward_flag }
		modifier = { stability_cost_modifier = -0.1 }
	}
	conditional_modifier = {
		trigger = { has_government_mechanic = russian_modernization_mechanic }
		modifier = { monthly_russian_modernization = -0.03 }
	}
	#conditional_modifier = {
	#	trigger = { has_government_mechanic = ottoman_decadence_mechanic }
	#	modifier = { monthly_ottoman_decadence = 0.02 }
	#}
	ai_will_do = {
		factor = 50
		modifier = {
			factor = 0.5
			is_absolutism_active = yes
		}
		modifier = {
			factor = 3
			uses_meritocracy = yes
		}
	}
}

estate_church_new_world_mission = {
	icon = privilege_new_world_mission
	max_absolutism = -5
	conditional_modifier = { trigger = { has_absolutism_reduction_for_estate_privileges = yes } modifier = { max_absolutism = 1 } }
	loyalty = 0.05
	influence = 0.05
	is_valid = {
		OR = {
			num_of_colonists = 1
			num_of_colonies = 1
		}
	}
	penalties = {
	}
	benefits = {
		native_assimilation = 0.5
	}
	on_granted = {
		if = {
			limit = { has_dlc = "Domination" }
			enable_estate_action = {
				estate_action = NEW_WORLD_MISSION_CHURCH
			}
		}
		else = {
			custom_tooltip = has_no_effects_on_granted
		}
	}
	on_invalid = {
		if = {
			limit = { has_dlc = "Domination" }
			disable_estate_action = {
				estate_action = NEW_WORLD_MISSION_CHURCH
			}
		}
		else = {
			hidden_effect = {
				disable_estate_action = {
					estate_action = NEW_WORLD_MISSION_CHURCH
				}
			}
		}
	}
	on_revoked = {
		if = {
			limit = { has_dlc = "Domination" }
			disable_estate_action = {
				estate_action = NEW_WORLD_MISSION_CHURCH
			}
		}
		else = {
			hidden_effect = {
				disable_estate_action = {
					estate_action = NEW_WORLD_MISSION_CHURCH
				}
			}
		}
	}
	conditional_modifier = {
		trigger = { has_government_mechanic = russian_modernization_mechanic }
		modifier = { monthly_russian_modernization = -0.03 }
	}
	#conditional_modifier = {
	#	trigger = { has_government_mechanic = ottoman_decadence_mechanic }
	#	modifier = { monthly_ottoman_decadence = 0.02 }
	#}
	ai_will_do = {
		factor = 0
	}
}

estate_church_papal_emissary = {
	icon = privilege_send_emissary_to_pope
	max_absolutism = -5
	conditional_modifier = { trigger = { has_absolutism_reduction_for_estate_privileges = yes } modifier = { max_absolutism = 1 } }
	loyalty = 0.05
	influence = 0.05
	is_valid = {
		religion = catholic
		NOT = { tag = PAP }
	}
	can_select = {
		papal_influence = 20
		num_of_cardinals = 1
	}
	on_granted = {
		add_papal_influence = -5
	}
	penalties = {
		curia_powers_cost = 0.05
	}
	benefits = {
		papal_influence = 1
	}
	conditional_modifier = {
		trigger = { has_government_mechanic = russian_modernization_mechanic }
		modifier = { monthly_russian_modernization = -0.03 }
	}
	#conditional_modifier = {
	#	trigger = { has_government_mechanic = ottoman_decadence_mechanic }
	#	modifier = { monthly_ottoman_decadence = 0.02 }
	#}
	ai_will_do = {
		factor = 10
		modifier = {
			factor = 0
			is_part_of_hre = yes
			is_emperor = no
		}
		modifier = {
			factor = 0
			OR = {
				tag = SWE
				tag = ENG
				tag = GBR
			}
		}
		modifier = {
			factor = 0
			is_absolutism_active = yes
		}
		modifier = {
			factor = 0.75
			NOT = {
				reverse_has_opinion = {
					who = PAP
					value = 50
				}
			}
		}
	}
}

estate_church_clerical_ministers = {
	icon = privilege_recruit_minister
	max_absolutism = -5
	conditional_modifier = { trigger = { has_absolutism_reduction_for_estate_privileges = yes } modifier = { max_absolutism = 1 } }
	influence = 0.10
	on_granted = {
		if = {
			limit = { has_estate_privilege = estate_church_freedom_of_interpretation }
			remove_estate_privilege = estate_church_freedom_of_interpretation
		}
		else = {
			custom_tooltip = has_no_effects_on_granted
		}
	}
	conditional_modifier = {
		trigger = {
			if = {
				limit = {
					has_dlc = "Common Sense"
				}
				NOT = { religion = protestant }
				NOT = { religion = buddhism }
				NOT = { religion = vajrayana }
				NOT = { religion = mahayana }
			}
			if = {
				limit = {
					has_dlc = "Emperor"
				}
				NOT = { religion = hussite }
			}
			if = {
				limit = {
					has_dlc = "Wealth of Nations"
				}
				NOT = { religion = reformed }
			}
			if = {
				limit = {
					has_dlc = "Cradle of Civilization"
				}
				NOT = { religion_group = muslim }
			}
			if = {
				limit = {
					has_dlc = "Mandate of Heaven"
				}
				NOT = { religion = confucianism }
			}
			if = {
				limit = {
					has_dlc = "Third Rome"
				}
				NOT = { religion = orthodox }
			}
			if = {
				limit = {
					has_dlc = "Origins"
				}
				NOT = { religion = jewish }
			}
			NOT = { religion = anglican }
		}
		modifier = {
			missionary_maintenance_cost = -0.2
		}
	}
	conditional_modifier = {
		trigger = {
			has_dlc = "Common Sense"
			OR = {
				religion = buddhism
				religion = vajrayana
				religion = mahayana
			}
		}
		modifier = {
			yearly_karma_decay = 0.05
		}
	}
	conditional_modifier = {
		trigger = {
			has_dlc = "Common Sense"
			religion = protestant
		}
		modifier = {
			church_power_modifier = 0.1
		}
	}
	conditional_modifier = {
		trigger = {
			has_dlc = "Emperor"
			religion = hussite
		}
		modifier = {
			church_power_modifier = 0.1
		}
	}
	conditional_modifier = {
		trigger = {
			has_dlc = "Origins"
			religion = jewish
		}
		modifier = {
			church_power_modifier = 0.1
		}
	}
	conditional_modifier = {
		trigger = {
			has_dlc = "Wealth of Nations"
			religion = reformed
		}
		modifier = {
			monthly_fervor_increase = 0.5
		}
	}
	conditional_modifier = {
		trigger = {
			has_dlc = "Cradle of Civilization"
			religion_group = muslim
			NOT = { has_country_flag = MUG_upgrade_clerical_ministers_flag }
		}
		modifier = {
			monthly_piety = 0.001
		}
	}
	conditional_modifier = {
		trigger = {
			has_dlc = "Cradle of Civilization"
			religion_group = muslim
			has_country_flag = MUG_upgrade_clerical_ministers_flag
		}
		modifier = {
			monthly_piety = 0.002
		}
	}
	conditional_modifier = {
		trigger = {
			has_dlc = "Mandate of Heaven"
			religion = confucianism
		}
		modifier = {
			yearly_harmony = 0.25
		}
	}
	conditional_modifier = {
		trigger = {
			religion = orthodox
			NOT = { has_country_flag = BYZ_buff_clerical_ministers_for_byz }
		}
		modifier = {
			yearly_patriarch_authority = 0.005
		}
	}
	conditional_modifier = {
		trigger = {
			religion = orthodox
			has_country_flag = BYZ_buff_clerical_ministers_for_byz
		}
		modifier = {
			yearly_patriarch_authority = 0.01
		}
	}
	conditional_modifier = {
		trigger = {
			religion = orthodox
			has_global_flag = BYZ_buff_clerical_ministers_for_orthodox
		}
		modifier = {
			tolerance_own = 1
		}
	}
	conditional_modifier = {
		trigger = {
			religion = anglican
		}
		modifier = {
			church_power_modifier = 0.1
		}
	}
	conditional_modifier = {
		trigger = {
			has_government_attribute = clerical_ministers_tech_buff
		}
		modifier = {
			technology_cost = -0.05
		}
	}
	
	conditional_modifier = {
		trigger = {
			has_country_flag = INC_modify_the_clerical_ministers_flag
		}
		modifier = {
			monthly_divine_authority = 0.05
			yearly_authority = 0.5
			church_loyalty_modifier = 0.05
		}
	}
	penalties = {
	}
	benefits = {
	}
	conditional_modifier = {
		trigger = { has_government_mechanic = russian_modernization_mechanic }
		modifier = { monthly_russian_modernization = -0.03 }
	}
	#conditional_modifier = {
	#	trigger = { has_government_mechanic = ottoman_decadence_mechanic }
	#	modifier = { monthly_ottoman_decadence = 0.02 }
	#}
	ai_will_do = {
		factor = 10
		modifier = {
			factor = 0.5
			is_absolutism_active = yes
		}
		modifier = {
			factor = 0.5
			OR = {
				religion = protestant
				religion = anglican
			}
			religion = protestant
			num_of_aspects = 3
		}
		modifier = {
			factor = 10
			religion = orthodox
			has_dlc = "Third Rome"
		}
	}
}

estate_church_freedom_of_interpretation = {
	icon = privilege_recruit_minister
	max_absolutism = -5
	conditional_modifier = { trigger = { has_absolutism_reduction_for_estate_privileges = yes } modifier = { max_absolutism = 1 } }
	influence = 0.10
	is_valid = {
		has_dlc = "Cradle of Civilization"
		religion_group = muslim
	}
	on_granted = {
		if = {
			limit = { has_estate_privilege = estate_church_clerical_ministers }
			remove_estate_privilege = estate_church_clerical_ministers
		}
		else_if = {
			limit = {
				has_country_flag = MUG_upgrade_freedom_of_interpretation_flag
			}
			custom_tooltip = MUG_conditional_modifier_info
		}
		else = {
			custom_tooltip = has_no_effects_on_granted
		}
	}
	conditional_modifier = {
		trigger = {
			has_government_attribute = clerical_ministers_tech_buff
		}
		modifier = {
			technology_cost = -0.05
		}
	}
	conditional_modifier = {
		trigger = {
			has_country_flag = MUG_upgrade_freedom_of_interpretation_flag
			NOT = { piety = -0.5 }
		}
		modifier = {
			morale_damage = 0.1
		}
	}
	conditional_modifier = {
		trigger = {
			has_country_flag = MUG_upgrade_freedom_of_interpretation_flag
		}
		modifier = {
			global_unrest = -1
		}
	}
	penalties = {
	}
	benefits = {
		monthly_piety = -0.001
	}
	conditional_modifier = {
		trigger = { has_government_mechanic = russian_modernization_mechanic }
		modifier = { monthly_russian_modernization = -0.03 }
	}
	#conditional_modifier = {
	#	trigger = { has_government_mechanic = ottoman_decadence_mechanic }
	#	modifier = { monthly_ottoman_decadence = 0.02 }
	#}
	ai_will_do = {
		factor = 10
		modifier = {
			factor = 0.5
			is_absolutism_active = yes
		}
	}
}

estate_church_clerical_oversight = {
	icon = privilege_tolerance_heathen
	max_absolutism = -10
	conditional_modifier = { trigger = { has_absolutism_reduction_for_estate_privileges = yes } modifier = { max_absolutism = 2 } }
	loyalty = 0.1
	influence = 0.1
	penalties = {
	}
	benefits = {
	}
	conditional_modifier = {
		trigger = { has_government_mechanic = russian_modernization_mechanic }
		modifier = { monthly_russian_modernization = -0.03 }
	}
	conditional_modifier = {
		trigger = { has_government_attribute = MAY_max_abso_buff }
		modifier = {
			max_absolutism_effect = 0.15
		}
	}
	ai_will_do = {
		factor = 1
		modifier = {
			factor = 0
			is_absolutism_active = yes
		}
	}
}

estate_church_inwards_perfection = {
	icon = privilege_grant_autonomy
	land_share = 5
	max_absolutism = -5
	conditional_modifier = { trigger = { has_absolutism_reduction_for_estate_privileges = yes } modifier = { max_absolutism = 1 } }
	loyalty = 0.05
	influence = 0.1
	is_valid = {
		religion_group = eastern
		NOT = { has_country_flag = mng_outward_perfection_flag } 
		NOT = { has_government_mechanic = perfectionism_mechanic }
	}
	can_select = {
		NOT = { has_estate_privilege = estate_church_for_the_faith }
		NOT = { has_country_flag = mng_outward_perfection_flag } 
		NOT = { has_estate_privilege = estate_church_inwards_perfection }
	}
	can_revoke = {
		is_at_war = no
	}
	on_granted = {
		if = { 
			limit = { has_estate_privilege = estate_eunuchs_outwards_perfection_privilege }
			remove_estate_privilege = estate_eunuchs_outwards_perfection_privilege 
		}
	}
	modifier_by_land_ownership = {
		development_cost = -0.33
		global_tax_modifier = 0.33
		production_efficiency = 0.33
		manpower_in_true_faith_provinces = 0.33
		core_creation = 1
		province_warscore_cost = 2
	}
	penalties = {
		stability_cost_to_declare_war = 1
	}
	benefits = {
		tolerance_own = 2
		war_exhaustion = -0.05
	}
	mechanics = {
		exempt_from_seize_land
	}
	conditional_modifier = {
		trigger = { has_country_flag = mng_amplify_inward_perfection_flag } 
		modifier = {
			all_estate_loyalty_equilibrium = 0.05 
			monarch_admin_power	= 1 
			global_allowed_num_of_buildings = 1 
			great_project_upgrade_cost = -0.1 
		}
	}
	conditional_modifier = {
		trigger = { has_government_mechanic = russian_modernization_mechanic }
		modifier = { monthly_russian_modernization = -0.03 }
	}
	#conditional_modifier = {
	#	trigger = { has_government_mechanic = ottoman_decadence_mechanic }
	#	modifier = { monthly_ottoman_decadence = 0.02 }
	#}
	conditional_modifier = {
		trigger = { ai = yes }	#I know, this one is cheating. It would be better to teach the AI to not dow, but whatev
		modifier = {
			can_not_declare_war = yes
		}
		is_bad = yes
	}
	influence_scaled_conditional_modifier = {
		trigger = { has_country_flag = hordes_inward_perfection_buff_flag }
		modifier = {
			global_unrest = -2
			imperial_mandate = 0.15
			monthly_reform_progress_modifier = 0.2
		}
	}
	cooldown_years = 25
	ai_will_do = {
		factor = 1
		modifier = {
			factor = 1000
			tag = KOR
			NOT = { num_of_cities = 30 }
			religion = confucianism
		}
	}
}

estate_church_enforced_one_faith = {
	icon = privilege_recruit_inouisitor
	max_absolutism = -5
	conditional_modifier = { trigger = { has_absolutism_reduction_for_estate_privileges = yes } modifier = { max_absolutism = 1 } }
	loyalty = 0.05
	is_valid = {
		any_owned_province = {
			NOT = { religion = root }
		}
	}
	can_select = {
		NOT = { has_estate_privilege = estate_burghers_enforced_interfaith_dialogue }
		NOT = { has_estate_privilege = estate_dhimmi_tolerance }
		NOT = { has_estate_privilege = estate_dhimmi_guarantee_of_traditions }
	}
	penalties = {
		tolerance_heathen = -2
		tolerance_heretic = -2
	}
	benefits = {
		global_missionary_strength = 0.01
		tolerance_own = 1
	}
	cooldown_years = 20
	on_cooldown_expires = {
		remove_estate_privilege = estate_church_enforced_one_faith
	}
	conditional_modifier = {
		trigger = { has_government_mechanic = russian_modernization_mechanic }
		modifier = { monthly_russian_modernization = -0.03 }
	}
	#conditional_modifier = {
	#	trigger = { has_government_mechanic = ottoman_decadence_mechanic }
	#	modifier = { monthly_ottoman_decadence = 0.02 }
	#}
	ai_will_do = {
		factor = 0
	}
}

estate_church_administrative_privileges = {
	icon = privilege_land_rights
	land_share = 5
	max_absolutism = -5
	conditional_modifier = { trigger = { has_absolutism_reduction_for_estate_privileges = yes } modifier = { max_absolutism = 1 } }
	loyalty = 0.1
	influence = 0.1
	is_valid = {
	}
	can_select = {
	}
	can_revoke = {
	}
	on_granted = {
	}
	modifier_by_land_ownership = {
		tolerance_own = 4
	}
	penalties = {
	}
	benefits = {
		war_exhaustion = -0.02
	}
	mechanics = {
		exempt_from_seize_land
	}
	cooldown_years = 25
	conditional_modifier = {
		trigger = { has_government_mechanic = russian_modernization_mechanic }
		modifier = { monthly_russian_modernization = -0.03 }
	}
	conditional_modifier = {
		trigger = { 
			has_country_flag = oma_church_admin_privileges_buff_flag
		}
		modifier = { 
			governing_capacity_modifier = 0.1
			monthly_piety_accelerator = 0.001
		}
	}
	ai_will_do = {
		factor = 0
	}
}

#DLC Privileges
estate_church_monopoly_of_incense = {
	icon = privilege_monopoly_of_goods_incence
	max_absolutism = -10
	conditional_modifier = { trigger = { has_absolutism_reduction_for_estate_privileges = yes } modifier = { max_absolutism = 2 } }
	loyalty = 0.05
	is_valid = {
		OR = {
			has_dlc = "Emperor"
			has_country_flag = buffed_monopolies
		}
		any_owned_province = {
			trade_goods = incense
		}
	}
	can_select = {
		custom_trigger_tooltip = {
			tooltip = unavailable_during_revolution_disaster
			NOT = { has_disaster = revolution }
			NOT = {
				has_disaster_progress = {
					disaster = revolution
					value = 1
				}
			}
			NOT = { has_disaster = french_revolution }
			NOT = {
				has_disaster_progress = {
					disaster = french_revolution
					value = 1
				}
			}
		}
	}
	on_granted = {
		if = {
			limit = {
				incense = 1
			}
			add_mercantilism = 1
		}
		add_years_of_owned_provinces_production_income = {
			years = 8
			trigger = {
				trade_goods = incense
			}
			custom_tooltip = MONOPOLY_INCOME_INCENSE_DESC
		}
		custom_tooltip = estate_church_monopoly_of_incense_effect_tooltip
	}
	on_granted_province = {
		if = {
			limit = {
				trade_goods = incense
			}
			add_province_modifier = {
				name = estate_church_monopoly_of_incense_mod
				duration = -1
			}
		}
		else_if = {
			limit = {
				has_province_modifier = estate_church_monopoly_of_incense_mod
			}
			remove_province_modifier = estate_church_monopoly_of_incense_mod
		}
	}
	on_revoked = {
		custom_tooltip = estate_church_monopoly_of_incense_revoke_tooltip
	}
	on_revoked_province = {
		if = {
			limit = {
				has_province_modifier = estate_church_monopoly_of_incense_mod
			}
			remove_province_modifier = estate_church_monopoly_of_incense_mod
		}
	}
	on_invalid = {
		custom_tooltip = estate_church_monopoly_of_incense_revoke_tooltip
	}
	on_invalid_province = {
		if = {
			limit = {
				has_province_modifier = estate_church_monopoly_of_incense_mod
			}
			remove_province_modifier = estate_church_monopoly_of_incense_mod
		}
	}
	penalties = {
	}
	benefits = {
	}
	cooldown_years = 10
	conditional_modifier = {
		trigger = {
			has_country_flag = buffed_monopolies
		}
		modifier = {
			max_absolutism = 10
			church_privilege_slots = 1
		}
	}
	on_cooldown_expires = {
		country_event = { id = monopoly_privileges.8 }
	}
	ai_will_do = {
		factor = 0
	}
}

estate_church_monopoly_of_wool = {
	icon = privilege_monopoly_of_goods_wool
	max_absolutism = -10
	conditional_modifier = { trigger = { has_absolutism_reduction_for_estate_privileges = yes } modifier = { max_absolutism = 2 } }
	loyalty = 0.05
	is_valid = {
		OR = {
			has_dlc = "Emperor"
			has_country_flag = buffed_monopolies
		}
		any_owned_province = {
			trade_goods = wool
		}
	}
	can_select = {
		custom_trigger_tooltip = {
			tooltip = unavailable_during_revolution_disaster
			NOT = { has_disaster = revolution }
			NOT = {
				has_disaster_progress = {
					disaster = revolution
					value = 1
				}
			}
			NOT = { has_disaster = french_revolution }
			NOT = {
				has_disaster_progress = {
					disaster = french_revolution
					value = 1
				}
			}
		}
	}
	on_granted = {
		if = {
			limit = {
				wool = 1
			}
			add_mercantilism = 1
		}
		add_years_of_owned_provinces_production_income = {
			years = 8
			trigger = {
				trade_goods = wool
			}
			custom_tooltip = MONOPOLY_INCOME_WOOL_DESC
		}
		custom_tooltip = estate_church_monopoly_of_wool_effect_tooltip
	}
	on_granted_province = {
		if = {
			limit = {
				trade_goods = wool
			}
			add_province_modifier = {
				name = estate_church_monopoly_of_wool_mod
				duration = -1
			}
		}
		else_if = {
			limit = {
				has_province_modifier = estate_church_monopoly_of_wool_mod
			}
			remove_province_modifier = estate_church_monopoly_of_wool_mod
		}
	}
	on_revoked = {
		custom_tooltip = estate_church_monopoly_of_wool_revoke_tooltip
	}
	on_revoked_province = {
		if = {
			limit = {
				has_province_modifier = estate_church_monopoly_of_wool_mod
			}
			remove_province_modifier = estate_church_monopoly_of_wool_mod
		}
	}
	on_invalid = {
		custom_tooltip = estate_church_monopoly_of_wool_revoke_tooltip
	}
	on_invalid_province = {
		if = {
			limit = {
				has_province_modifier = estate_church_monopoly_of_wool_mod
			}
			remove_province_modifier = estate_church_monopoly_of_wool_mod
		}
	}
	penalties = {
	}
	benefits = {
	}
	cooldown_years = 10
	conditional_modifier = {
		trigger = {
			has_country_flag = buffed_monopolies
		}
		modifier = {
			max_absolutism = 10
			church_privilege_slots = 1
		}
	}
	on_cooldown_expires = {
		country_event = { id = monopoly_privileges.9 }
	}
	ai_will_do = {
		factor = 0
	}
}

estate_church_monopoly_of_wine = {
	icon = privilege_monopoly_of_goods_wine
	max_absolutism = -10
	conditional_modifier = { trigger = { has_absolutism_reduction_for_estate_privileges = yes } modifier = { max_absolutism = 2 } }
	loyalty = 0.05
	is_valid = {
		OR = {
			has_dlc = "Emperor"
			has_country_flag = buffed_monopolies
		}
		NOT = { religion_group = muslim }
		any_owned_province = {
			trade_goods = wine
		}
	}
	can_select = {
		custom_trigger_tooltip = {
			tooltip = unavailable_during_revolution_disaster
			NOT = { has_disaster = revolution }
			NOT = {
				has_disaster_progress = {
					disaster = revolution
					value = 1
				}
			}
			NOT = { has_disaster = french_revolution }
			NOT = {
				has_disaster_progress = {
					disaster = french_revolution
					value = 1
				}
			}
		}
	}
	on_granted = {
		if = {
			limit = {
				has_country_flag = ITA_wine_monopolies_flag
			}
			if = {
				limit = {
					wine = 1
				}
				add_mercantilism = 2
			}
			add_years_of_owned_provinces_production_income = {
				years = 12
				trigger = {
					trade_goods = wine
				}
				custom_tooltip = ITA_12_years_of_income_wine
			}
		}
		else = {
			if = {
				limit = {
					wine = 1
				}
				add_mercantilism = 1
			}
			add_years_of_owned_provinces_production_income = {
				years = 8
				trigger = {
					trade_goods = wine
				}
				custom_tooltip = MONOPOLY_INCOME_WINE_DESC
			}
		}
		custom_tooltip = estate_church_monopoly_of_wine_effect_tooltip
	}
	on_granted_province = {
		if = {
			limit = {
				trade_goods = wine
			}
			add_province_modifier = {
				name = estate_church_monopoly_of_wine_mod
				duration = -1
			}
		}
		else_if = {
			limit = {
				has_province_modifier = estate_church_monopoly_of_wine_mod
			}
			remove_province_modifier = estate_church_monopoly_of_wine_mod
		}
	}
	on_revoked = {
		custom_tooltip = estate_church_monopoly_of_wine_revoke_tooltip
	}
	on_revoked_province = {
		if = {
			limit = {
				has_province_modifier = estate_church_monopoly_of_wine_mod
			}
			remove_province_modifier = estate_church_monopoly_of_wine_mod
		}
	}
	on_invalid = {
		custom_tooltip = estate_church_monopoly_of_wine_revoke_tooltip
	}
	on_invalid_province = {
		if = {
			limit = {
				has_province_modifier = estate_church_monopoly_of_wine_mod
			}
			remove_province_modifier = estate_church_monopoly_of_wine_mod
		}
	}
	penalties = {
	}
	benefits = {
	}
	cooldown_years = 10
	conditional_modifier = {
		trigger = {
			has_country_flag = buffed_monopolies
		}
		modifier = {
			max_absolutism = 10
			church_privilege_slots = 1
		}
	}
	on_cooldown_expires = {
		country_event = { id = monopoly_privileges.10 }
	}
	ai_will_do = {
		factor = 0
	}
}

estate_church_monopoly_of_slaves = {
	icon = privilege_monopoly_of_goods_slaves
	max_absolutism = -10
	conditional_modifier = { trigger = { has_absolutism_reduction_for_estate_privileges = yes } modifier = { max_absolutism = 2 } }
	loyalty = 0.05
	is_valid = {
		OR = {
			has_dlc = "Emperor"
			has_country_flag = buffed_monopolies
		}
		religion = nahuatl
		any_owned_province = {
			trade_goods = slaves
		}
	}
	can_select = {
		custom_trigger_tooltip = {
			tooltip = unavailable_during_revolution_disaster
			NOT = { has_disaster = revolution }
			NOT = {
				has_disaster_progress = {
					disaster = revolution
					value = 1
				}
			}
			NOT = { has_disaster = french_revolution }
			NOT = {
				has_disaster_progress = {
					disaster = french_revolution
					value = 1
				}
			}
		}
	}
	on_granted = {
		if = {
			limit = {
				slaves = 1
			}
			add_mercantilism = 1
		}
		add_years_of_owned_provinces_production_income = {
			years = 8
			trigger = {
				trade_goods = slaves
			}
			custom_tooltip = MONOPOLY_INCOME_SLAVES_DESC
		}
		custom_tooltip = estate_church_monopoly_of_slaves_effect_tooltip
	}
	on_granted_province = {
		if = {
			limit = {
				trade_goods = slaves
			}
			add_province_modifier = {
				name = estate_church_monopoly_of_slaves_mod
				duration = -1
			}
		}
		else_if = {
			limit = {
				has_province_modifier = estate_church_monopoly_of_slaves_mod
			}
			remove_province_modifier = estate_church_monopoly_of_slaves_mod
		}
	}
	on_revoked = {
		custom_tooltip = estate_church_monopoly_of_slaves_revoke_tooltip
	}
	on_revoked_province = {
		if = {
			limit = {
				has_province_modifier = estate_church_monopoly_of_slaves_mod
			}
			remove_province_modifier = estate_church_monopoly_of_slaves_mod
		}
	}
	on_invalid = {
		custom_tooltip = estate_church_monopoly_of_slaves_revoke_tooltip
	}
	on_invalid_province = {
		if = {
			limit = {
				has_province_modifier = estate_church_monopoly_of_slaves_mod
			}
			remove_province_modifier = estate_church_monopoly_of_slaves_mod
		}
	}
	penalties = {
	}
	benefits = {
	}
	cooldown_years = 10
	conditional_modifier = {
		trigger = {
			has_country_flag = buffed_monopolies
		}
		modifier = {
			max_absolutism = 10
			church_privilege_slots = 1
		}
	}
	on_cooldown_expires = {
		country_event = { id = monopoly_privileges.11 }
	}
	ai_will_do = {
		factor = 0
	}
}

estate_church_for_the_faith = {
	icon = privilege_recruit_inouisitor
	max_absolutism = -5
	conditional_modifier = { trigger = { has_absolutism_reduction_for_estate_privileges = yes } modifier = { max_absolutism = 1 } }
	is_valid = {
		OR = {
			has_dlc = "Emperor"
			has_dlc = "Lions of the North"
		}
		NOT = { religion = confucianism }
		OR = {
			has_country_flag = improved_expansionist_zealotry
			any_known_country = {
				NOT = { religion = root }
			}
			has_country_modifier = recently_force_converted_protagonist_timer
			has_country_modifier = recently_annexed_other_religion_timer
		}
	}
	can_select = {
		OR = {
			has_country_flag = improved_expansionist_zealotry
			any_known_country = {
				NOT = { religion = root }
			}
		}
		NOT = { has_estate_privilege = estate_church_inwards_perfection }
	}
	on_granted = {
		if = {
			limit = { has_government_attribute = free_expansionist_zealotry }
			custom_tooltip = estate_church_for_the_faith_effect_tooltip_a
		}
		else = {
			custom_tooltip = estate_church_for_the_faith_effect_tooltip
		}
	}
	on_revoked = {
		if = {
			limit = { has_government_attribute = free_expansionist_zealotry }
			custom_tooltip = estate_church_for_the_faith_effect_tooltip_a
		}
		else = {
			custom_tooltip = estate_church_for_the_faith_effect_tooltip
		}
	}
	conditional_modifier = {
		trigger = {
			any_known_country = {
				NOT = { religion = root }
				war_with = root
			}
			NOT = { has_country_flag = improved_expansionist_zealotry }
		}
		modifier = {
			church_loyalty_modifier = 0.1
			land_morale = 0.05
		}
	}
	conditional_modifier = {
		trigger = {
			any_known_country = {
				NOT = { religion = root }
				war_with = root
			}
			has_country_flag = improved_expansionist_zealotry
		}
		modifier = {
			church_loyalty_modifier = 0.1
			land_morale = 0.15
			war_exhaustion = -0.05
			max_absolutism = 5
		}
	}
	conditional_modifier = {
		trigger = {
			NOT = {
				any_known_country = {
					NOT = { religion = root }
					OR = {
						war_with = root
						truce_with = root
					}
				}
			}
			NOT = { has_country_modifier = recently_force_converted_protagonist_timer }
			NOT = { has_country_modifier = recently_annexed_other_religion_timer }
			NOT = { has_country_flag = improved_expansionist_zealotry }
			NOT = { has_government_attribute = free_expansionist_zealotry }
		}
		modifier = {
			church_loyalty_modifier = -0.1
			land_morale = -0.05
		}
		is_bad = yes
	}
	conditional_modifier = {
		trigger = {
			has_government_attribute = free_expansionist_zealotry
		}
		modifier = {
			max_absolutism = 5
		}
	}
	penalties = {
	}
	conditional_modifier = {
		trigger = { has_government_mechanic = russian_modernization_mechanic }
		modifier = { monthly_russian_modernization = -0.03 }
	}
	#conditional_modifier = {
	#	trigger = { has_government_mechanic = ottoman_decadence_mechanic }
	#	modifier = { monthly_ottoman_decadence = 0.02 }
	#}
	ai_will_do = {
		factor = 0
	}
}

estate_church_statutory_rights = {
	icon = privilege_grant_autonomy
	max_absolutism = -5
	conditional_modifier = { trigger = { has_absolutism_reduction_for_estate_privileges = yes } modifier = { max_absolutism = 1 } }
	influence = 0.1
	is_valid = {
		has_estate_privilege = estate_church_statutory_rights
	}
	on_granted = {
		change_estate_land_share = {
			estate = all
			share = -30
		}
	}
	penalties = {
		min_autonomy = 25
	}
	benefits = {
	}
	conditional_modifier = {
		trigger = { has_government_mechanic = russian_modernization_mechanic }
		modifier = { monthly_russian_modernization = -0.03 }
	}
	#conditional_modifier = {
	#	trigger = { has_government_mechanic = ottoman_decadence_mechanic }
	#	modifier = { monthly_ottoman_decadence = 0.02 }
	#}
	ai_will_do = {
		factor = 0
	}
	cooldown_years = 20
}

estate_church_brahmins_at_court = {
	icon = privilege_seek_support_of_brahmins
	can_select = {
		if = {
			limit = {
				has_mission = mnd_khm_religion
			}
			mission_completed = mnd_khm_religion
		}
		else_if = {
			limit = {
				has_mission = mnd_khm_religion
			}
			mission_completed = mnd_siam_devaraja
		}
		else = {
			has_estate_privilege = estate_church_brahmins_at_court
		}
		religion_group = eastern
	}
	is_valid = {
		religion_group = eastern
		OR = {
			has_mission = mnd_khm_religion
			has_mission = mnd_siam_devaraja
			has_estate_privilege = estate_church_brahmins_at_court
		}
	}
	on_granted = {
		custom_tooltip = estate_brahmins_guaranteed_autonomy_effect_tooltip
	}
	on_granted_province = {
		if = {
			limit = {
				religion_group = dharmic
			}
			add_province_modifier = {
				name = estate_brahmins_guaranteed_autonomy_mod
				duration = -1
			}
		}
		else_if = {
			limit = {
				has_province_modifier = estate_brahmins_guaranteed_autonomy_mod
			}
			remove_province_modifier = estate_brahmins_guaranteed_autonomy_mod
		}
	}
	on_revoked = {
		custom_tooltip = estate_brahmins_guaranteed_autonomy_revoke_effect_tooltip
	}
	on_revoked_province = {
		if = {
			limit = {
				has_province_modifier = estate_brahmins_guaranteed_autonomy_mod
			}
			remove_province_modifier = estate_brahmins_guaranteed_autonomy_mod
		}
	}
	on_invalid = {
		custom_tooltip = estate_brahmins_guaranteed_autonomy_revoke_effect_tooltip
	}
	on_invalid_province = {
		if = {
			limit = {
				has_province_modifier = estate_brahmins_guaranteed_autonomy_mod
			}
			remove_province_modifier = estate_brahmins_guaranteed_autonomy_mod
		}
	}
	penalties = {
	}
	benefits = {
	}
	conditional_modifier = {
		trigger = { has_government_mechanic = russian_modernization_mechanic }
		modifier = { monthly_russian_modernization = -0.03 }
	}
	#conditional_modifier = {
	#	trigger = { has_government_mechanic = ottoman_decadence_mechanic }
	#	modifier = { monthly_ottoman_decadence = 0.02 }
	#}
	ai_will_do = {
		factor = 1000
	}
}

estate_church_karma_temples = {
	icon = privilege_build_jain_temple
	max_absolutism = -5
	conditional_modifier = { trigger = { has_absolutism_reduction_for_estate_privileges = yes } modifier = { max_absolutism = 1 } }
	loyalty = 0.05
	influence = 0.05
	is_valid = {
		has_dlc = "Common Sense"
		OR = {
			religion = buddhism
			religion = mahayana
			religion = vajrayana
		}
	}
	can_select = {
	}
	on_granted = {
		if = {
			limit = {
				has_government_attribute = buffed_monastic_temples
			}
			custom_tooltip = estate_church_karma_temples_ct
		}
		else = {
			custom_tooltip = estate_church_karma_temples_tt
		}
	}
	conditional_modifier = {
		trigger = {
			has_government_attribute = buffed_monastic_temples
		}
		modifier = {
			max_absolutism = 5
			church_influence_modifier = -0.1
			yearly_karma_decay = 0.03
		}
	}
	penalties = {
	}
	benefits = {
	}
	conditional_modifier = {
		trigger = { has_government_mechanic = russian_modernization_mechanic }
		modifier = { monthly_russian_modernization = -0.03 }
	}
	#conditional_modifier = {
	#	trigger = { has_government_mechanic = ottoman_decadence_mechanic }
	#	modifier = { monthly_ottoman_decadence = 0.02 }
	#}
	ai_will_do = {
		factor = 10
	}
}

estate_church_influence_temples = {
	icon = privilege_promoto_dhimmi_nobles
	max_absolutism = -5
	conditional_modifier = { trigger = { has_absolutism_reduction_for_estate_privileges = yes } modifier = { max_absolutism = 1 } }
	loyalty = 0.05
	influence = 0.05
	is_valid = {
		religion = catholic
	}
	can_select = {
		religion = catholic
	}
	on_granted = {
		custom_tooltip = estate_church_influence_temples_tt
	}
	penalties = {
	}
	benefits = {
	}
	conditional_modifier = {
		trigger = { has_government_mechanic = russian_modernization_mechanic }
		modifier = { monthly_russian_modernization = -0.03 }
	}
	#conditional_modifier = {
	#	trigger = { has_government_mechanic = ottoman_decadence_mechanic }
	#	modifier = { monthly_ottoman_decadence = 0.02 }
	#}
	ai_will_do = {
		factor = 0
	}
}

estate_church_lao_animism = {
	icon = privilege_tolerance_heathen
	loyalty = -0.05
	influence = 0.6
	can_select = {
		primary_culture = lao
		religion_group = eastern
	}
	is_valid = {
		OR = {
			has_estate_privilege = estate_church_lao_animism
			AND = {
				religion_group = eastern
				primary_culture = lao
			}
		}
	}
	on_granted = {
		custom_tooltip = estate_church_lao_animism_effect_tooltip
	}
	on_granted_province = {
		if = {
			limit = {
				religion = animism
			}
			add_province_modifier = {
				name = estate_church_lao_animism_mod
				duration = -1
			}
		}
		else_if = {
			limit = {
				has_province_modifier = estate_church_lao_animism_mod
			}
			remove_province_modifier = estate_church_lao_animism_mod
		}
	}
	on_revoked = {
		custom_tooltip = estate_church_lao_animism_revoke_effect_tooltip
	}
	on_revoked_province = {
		if = {
			limit = {
				has_province_modifier = estate_church_lao_animism_mod
			}
			remove_province_modifier = estate_church_lao_animism_mod
		}
	}
	on_invalid = {
		custom_tooltip = estate_church_lao_animism_revoke_effect_tooltip
	}
	on_invalid_province = {
		if = {
			limit = {
				has_province_modifier = estate_church_lao_animism_mod
			}
			remove_province_modifier = estate_church_lao_animism_mod
		}
	}
	penalties = {
		tolerance_own = -2
	}
	benefits = {
		tolerance_heathen = 5
	}
	conditional_modifier = {
		trigger = { has_government_mechanic = russian_modernization_mechanic }
		modifier = { monthly_russian_modernization = -0.03 }
	}
	#conditional_modifier = {
	#	trigger = { has_government_mechanic = ottoman_decadence_mechanic }
	#	modifier = { monthly_ottoman_decadence = 0.02 }
	#}
	ai_will_do = {
		factor = 1000
	}
}

estate_church_religious_diplomats = {
	icon = privilege_religious_diplomats
	max_absolutism = -10
	conditional_modifier = { trigger = { has_absolutism_reduction_for_estate_privileges = yes } modifier = { max_absolutism = 2 } }
	conditional_modifier = {
		trigger = {
			has_country_flag = ITA_religious_diplomats_flag
		}
		modifier = {
			max_absolutism = 10
		}
	}
	conditional_modifier = {
		trigger = {
			has_country_flag = hun_empower_religious_diplomats
		}
		modifier = {
			relation_with_same_religion = 10
			reverse_relation_with_same_religion = 10
		}
	}
	conditional_modifier = {
		trigger = {
			has_country_flag = ITA_religious_diplomats_flag
			any_ally = {
				religion = coptic
			}
		}
		modifier = {
			tolerance_heretic = 2
		}
	}
	conditional_modifier = {
		trigger = {
			has_country_flag = TIM_religious_diplomats_hanbali
			has_country_modifier = hanbali_scholar_modifier 
		}
		modifier = {
			tolerance_own = 1 
		}
	}
	influence = 0.1
	loyalty = 0
	is_valid = {
	}
	can_select = {
	}
	on_granted = {
		#add_increase_same_religion_opinion = yes
		if = {
			limit = {
				has_country_flag = ITA_religious_diplomats_flag
			}
			custom_tooltip = ITA_having_a_coptic_ally
		}
		if = {
			limit = {
				has_country_flag = TIM_religious_diplomats_hanbali 
			}
			custom_tooltip = TIM_hanbali_scholar
		}
	}
	on_revoked = {
		#remove_increase_same_religion_opinion = yes
	}
	on_invalid = {
		#remove_increase_same_religion_opinion = yes
	}
	penalties = {
	}
	benefits = {

	}
	conditional_modifier = { #That way the modifiers won't seem duplicated
		trigger = {
			NOT = { has_country_flag = orm_religious_diplomats_buff_flag }
		}
		modifier = {
			diplomatic_reputation = 1
			relation_with_same_religion = 10
			reverse_relation_with_same_religion = 10
		}
	}
	conditional_modifier = {
		trigger = {
			has_country_flag = orm_religious_diplomats_buff_flag
		}
		modifier = {
			diplomatic_reputation = 2
			relation_with_same_religion = 20
			reverse_relation_with_same_religion = 20
			improve_relation_modifier = 0.1
		}
	}
	conditional_modifier = {
		trigger = {
			has_government_attribute = improved_defender_of_faith
			is_defender_of_faith = yes
		}
		modifier = {
			max_absolutism = 10
			church_influence_modifier = -0.15
		}
	}
	conditional_modifier = {
		trigger = {
			has_global_flag = free_religious_diplomats_for_all_zoro_countries
			religion_group = zoroastrian_group
		}
		modifier = {
			max_absolutism = 10
			church_influence_modifier = -0.1
			church_privilege_slots = 1
			church_loyalty_modifier = 0.1
		}
	}
	conditional_modifier = {
		trigger = { has_government_mechanic = russian_modernization_mechanic }
		modifier = { monthly_russian_modernization = -0.03 }
	}
	#conditional_modifier = {
	#	trigger = { has_government_mechanic = ottoman_decadence_mechanic }
	#	modifier = { monthly_ottoman_decadence = 0.02 }
	#}
	ai_will_do = {
		factor = 20	#The privilege is a little bit too niche to be really usable for the AI
	}
}

estate_church_one_faith_one_culture = {
	icon = privilege_one_faith_one_culture
	max_absolutism = -5
	conditional_modifier = { trigger = { has_absolutism_reduction_for_estate_privileges = yes } modifier = { max_absolutism = 1 } }
	influence = 0.1
	loyalty = 0.05
	land_share = 5
	is_valid = {
	}
	can_select = {
	}
	on_granted = {
		if = {
			limit = {
				has_country_flag = hormuz_religious_propagations_buffs_flag
			}
			custom_tooltip = estate_church_one_faith_one_culture_buffed_gta
		}
		else = {
			custom_tooltip = estate_church_one_faith_one_culture_gta
		}
		custom_tooltip = estate_church_one_faith_one_culture_gtb
	}
	on_granted_province = {
		if = {
			limit = {
				OR = {
					religion = ROOT
					AND = {
						religion = THIS
						owner = {
							has_harmonized_with = PREV
						}
					}
					AND = {
						religion = THIS
						owner = {
							secondary_religion = PREV
						}
					}
				}
				OR = {
					has_owner_accepted_culture = yes
					culture_group = ROOT
				}
			}
			if = {
				limit = {
					owner = { has_country_flag = hormuz_religious_propagations_buffs_flag }
				}
				add_province_modifier = {
					name = orm_religious_culture_buff
					duration = -1
				}
			}
			else = {
				add_province_modifier = {
					name = estate_church_united_faith_and_culture
					duration = -1
				}
			}
		}
		else_if = {
			limit = {
				has_province_modifier = estate_church_united_faith_and_culture
			}
			remove_province_modifier = estate_church_united_faith_and_culture
		}
		if = {
			limit = {
				NOT = { culture_group = ROOT }
				has_owner_accepted_culture = no
			}
			add_province_modifier = {
				name = estate_church_false_culture
				duration = -1
			}
		}
		else_if = {
			limit = {
				has_province_modifier = estate_church_false_culture
			}
			remove_province_modifier = estate_church_false_culture
		}
	}
	on_revoked = {
		custom_tooltip = estate_church_one_faith_one_culture_rta
		custom_tooltip = estate_church_one_faith_one_culture_rtb
	}
	on_revoked_province = {
		if = {
			limit = {
				has_province_modifier = estate_church_united_faith_and_culture
			}
			remove_province_modifier = estate_church_united_faith_and_culture
		}
		if = {
			limit = {
				has_province_modifier = estate_church_false_culture
			}
			remove_province_modifier = estate_church_false_culture
		}
		if = {
			limit = {
				has_province_modifier = orm_religious_culture_buff
			}
			remove_province_modifier = orm_religious_culture_buff
		}
	}
	on_invalid = {
		custom_tooltip = estate_church_one_faith_one_culture_rta
		custom_tooltip = estate_church_one_faith_one_culture_rtb
	}
	on_invalid_province = {
		if = {
			limit = {
				has_province_modifier = estate_church_united_faith_and_culture
			}
			remove_province_modifier = estate_church_united_faith_and_culture
		}
		if = {
			limit = {
				has_province_modifier = estate_church_false_culture
			}
			remove_province_modifier = estate_church_false_culture
		}
		if = {
			limit = {
				has_province_modifier = orm_religious_culture_buff
			}
			remove_province_modifier = orm_religious_culture_buff
		}
	}
	penalties = {
		tolerance_heathen = -2
		tolerance_heretic = -2
	}
	benefits = {
		global_missionary_strength = 0.01
	}
	conditional_modifier = {
		trigger = { has_government_attribute = free_religious_culture }
		modifier = {
			church_influence_modifier = -0.2
		}
	}
	
	conditional_modifier = {
		trigger = {
			has_global_flag = wahabism_founded
			religious_school = {
				group = muslim
				school = hanbali_school
			}
		}
		modifier = {
			tolerance_own = 2
		}
	}
	
	conditional_modifier = {
		trigger = { has_government_mechanic = russian_modernization_mechanic }
		modifier = { monthly_russian_modernization = -0.03 }
	}
	#conditional_modifier = {
	#	trigger = { has_government_mechanic = ottoman_decadence_mechanic }
	#	modifier = { monthly_ottoman_decadence = 0.02 }
	#}
	cooldown_years = 15
	ai_will_do = {
		factor = 10
		modifier = {
			factor = 0
			NOT = { dominant_religion = ROOT }
		}
		modifier = {
			factor = 0
			NOT = { dominant_culture = ROOT }
		}
		modifier = {
			factor = 0
			NOT = { religion = confucianism }
		}
		modifier = {
			factor = 0
			NOT = { religion = confucianism }
		}
		modifier = {
			factor = 100
			NOT = { average_autonomy = 15 }
			dominant_religion = ROOT
			dominant_culture = ROOT
		}
		modifier = {
			factor = 0.1
			is_absolutism_active = yes
		}
	}
}

###FETISHIST PRIVILEGES###
#Privilege to enable cults for heirs
estate_church_heir_shrine = {
	icon = privilege_heir_cult
	max_absolutism = -10
	conditional_modifier = { trigger = { has_absolutism_reduction_for_estate_privileges = yes } modifier = { max_absolutism = 2 } }
	influence = 0.1
	loyalty = 0
	is_valid = {
		religion = shamanism
		has_dlc = "Rights of Man"
		NOT = { has_country_flag = heir_cult_through_missions }
		has_government_attribute = heir
	}
	can_select = {
		NOT = { has_estate_privilege = estate_church_embrace_singluar_cult }
	}
	on_granted = {
		enable_cult_for_heirs = yes
	}
	on_revoked = {
		disable_cult_for_heirs = yes
	}
	on_invalid = {
		disable_cult_for_heirs = yes
	}
	penalties = {
	}
	benefits = {
	}
	conditional_modifier = {
		trigger = { has_government_attribute = no_influence_from_fetishist_privileges }
		modifier = {
			church_influence_modifier = -0.2
		}
	}
	ai_will_do = {
		factor = 100
		modifier = {
			factor = 0.1
			is_absolutism_active = yes
		}
		modifier = {
			factor = 0
			has_mission = kon_collect_cults
		}
		modifier = {
			factor = 0
			has_mission = zim_cults
		}
	}
}

#Privilege to enable primary cults
estate_church_embrace_singluar_cult = {
	icon = privilege_singular_cult
	max_absolutism = -5
	conditional_modifier = { trigger = { has_absolutism_reduction_for_estate_privileges = yes } modifier = { max_absolutism = 1 } }
	influence = 0.1
	loyalty = 0
	is_valid = {
		religion = shamanism
		has_dlc = "Rights of Man"
	}
	can_select = {
		NOT = { has_estate_privilege = estate_church_flexible_cults }
		NOT = { has_estate_privilege = estate_church_heir_shrine }
	}
	on_granted = {
		enable_primary_cult = yes
	}
	on_revoked = {
		disable_primary_cult = yes
		add_stability = -1
	}
	on_invalid = {
		disable_primary_cult = yes
	}
	penalties = {
	}
	benefits = {
		no_stability_loss_on_monarch_death = yes
	}
	conditional_modifier = {
		trigger = { has_government_attribute = no_influence_from_fetishist_privileges }
		modifier = {
			church_influence_modifier = -0.25
		}
	}
	ai_will_do = {
		factor = 1000
		modifier = {
			factor = 0
			NOT = { has_mission = zim_cults }
		}
	}
}

#Privilge to enable cult switching
estate_church_flexible_cults = {
	icon = privilege_switch_hindu_deity
	max_absolutism = -10
	conditional_modifier = { trigger = { has_absolutism_reduction_for_estate_privileges = yes } modifier = { max_absolutism = 2 } }
	influence = 0.05
	is_valid = {
		religion = shamanism
		has_dlc = "Rights of Man"
		NOT = { has_country_flag = enabled_cult_switching_mission }
	}
	can_select = {
		NOT = { has_estate_privilege = estate_church_embrace_singluar_cult }
	}
	on_granted = {
		enable_cult_switching = yes
	}
	on_revoked = {
		disable_cult_switching = yes
	}
	on_invalid = {
		disable_cult_switching = yes
	}
	penalties = {
	}
	benefits = {
	}
	conditional_modifier = {
		trigger = { has_government_attribute = no_influence_from_fetishist_privileges }
		modifier = {
			church_influence_modifier = -0.05
		}
	}
	ai_will_do = {
		factor = 0	#Not really needed, the AI should choose the right Cult from the get-go
	}
}

###MUSLIM PRIVILEGES###
#Privilege to remove adm cost of scholars
estate_church_scholar_connections = {
	icon = privilege_recruit_minister
	max_absolutism = -5
	conditional_modifier = { trigger = { has_absolutism_reduction_for_estate_privileges = yes } modifier = { max_absolutism = 1 } }
	influence = 0.05
	loyalty = 0
	is_valid = {
		religion_group = muslim
		has_dlc = "Cradle of Civilization"
	}
	can_select = {
	}
	on_granted = {
		disable_scholar_cost = yes
	}
	on_revoked = {
		enable_scholar_cost = yes
	}
	on_invalid = {
		enable_scholar_cost = yes
	}
	penalties = {
	}
	benefits = {
	}
	conditional_modifier = {
		trigger = { has_government_mechanic = russian_modernization_mechanic }
		modifier = { monthly_russian_modernization = -0.03 }
	}
	#conditional_modifier = {
	#	trigger = { has_government_mechanic = ottoman_decadence_mechanic }
	#	modifier = { monthly_ottoman_decadence = 0.02 }
	#}
	ai_will_do = {
		factor = 15
		modifier = {
			factor = 0
			is_absolutism_active = yes
		}
	}
}

#Privilege to remove the diplo requirement for one school
estate_church_integrated_school = {
	icon = privilege_seek_support_of_clergy
	max_absolutism = -5
	conditional_modifier = { trigger = { has_absolutism_reduction_for_estate_privileges = yes } modifier = { max_absolutism = 1 } }
	influence = 0.05
	loyalty = 0
	is_valid = {
		NOT = { has_country_flag = enabled_baseline_invite_scholar_no_priv }
		religion_group = muslim
		has_dlc = "Cradle of Civilization"
	}
	can_select = {
	}
	on_granted = {
		enable_baseline_invite_scholar = yes
	}
	on_revoked = {
		disable_baseline_invite_scholar = yes
	}
	on_invalid = {
		disable_baseline_invite_scholar = yes
	}
	penalties = {
	}
	benefits = {
	}
	conditional_modifier = {
		trigger = { has_government_mechanic = russian_modernization_mechanic }
		modifier = { monthly_russian_modernization = -0.03 }
	}
	#conditional_modifier = {
	#	trigger = { has_government_mechanic = ottoman_decadence_mechanic }
	#	modifier = { monthly_ottoman_decadence = 0.02 }
	#}
	ai_will_do = {
		factor = 15
		modifier = {
			factor = 0
			is_absolutism_active = yes
		}
	}
}

#Mission tree rewards
estate_church_yakobs_churches = {
	icon = privilege_recruit_inouisitor
	max_absolutism = -5
	conditional_modifier = { trigger = { has_absolutism_reduction_for_estate_privileges = yes } modifier = { max_absolutism = 1 } }
	influence = 0.1
	loyalty = 0.1
	is_valid = {
		has_unlocked_estate_privilege = { estate_privilege = estate_church_yakobs_churches }
		religion_group = christian
	}
	can_select = {
		religion_group = christian
	}
	on_granted = {
	}
	on_revoked = {
	}
	penalties = {
		global_tax_modifier = -0.1
	}
	benefits = {
		tolerance_own = 1
		global_missionary_strength = 0.01
		monthly_reform_progress_modifier = 0.25
	}
	ai_will_do = {
		factor = 10
		modifier = {
			factor = 0.5
			current_age = age_of_discovery
		}
		modifier = {
			factor = 0.5
			is_absolutism_active = yes
		}
		modifier = {
			factor = 2
			NOT = { dominant_religion = ROOT }
		}
		modifier = {
			factor = 1000
			has_mission = eth_reform_the_negusa_government
			NOT = { mission_completed = eth_reform_the_negusa_government }
		}
	}
}

estate_church_anti_heresy_act = {
	icon = privilege_recruit_inouisitor
	max_absolutism = -5
	conditional_modifier = { trigger = { has_absolutism_reduction_for_estate_privileges = yes } modifier = { max_absolutism = 1 } }
	loyalty = 0.05
	influence = 0.05
	is_valid = {
		has_unlocked_estate_privilege = { estate_privilege = estate_church_anti_heresy_act }
	}
	can_select = {
		religion_group = christian
		NOT = { religion = orthodox }
		NOT = { religion = coptic }
		any_owned_province = {
			religion_group = ROOT
			NOT = { religion = ROOT }
		}
	}
	on_granted = {
		if = {
			limit = { has_estate_privilege = estate_burghers_orthodox_tolerance }
			remove_estate_privilege = estate_burghers_orthodox_tolerance
			add_estate_loyalty = {
				estate = estate_burghers
				loyalty = -20
			}
		}
		else = {
			custom_tooltip = has_no_effects_on_granted
		}
	}
	penalties = {
		burghers_loyalty_modifier = -0.1
	}
	benefits = {
		global_heretic_missionary_strength = 0.02
	}
	ai_will_do = {
		factor = 0
	}
}

#Livonian starting privileges
estate_church_lands_of_riga = {
	icon = privilege_devotion_red
	max_absolutism = -20
	conditional_modifier = { trigger = { has_absolutism_reduction_for_estate_privileges = yes } modifier = { max_absolutism = 4 } }
	influence = 0.05
	land_share = 6
	loyalty = 0.25
	is_valid = {
		has_dlc = "Lions of the North"
		has_estate_privilege = estate_church_lands_of_riga
	}
	can_revoke = {
		owns_core_province = 37
		owns_core_province = 4241
		if = {
			limit = { has_mission = liv_handle_riga }
			mission_completed = liv_handle_riga
		}
		NOT = { has_estate_privilege = estate_church_bishopric_of_dorpat }
		NOT = { has_estate_privilege = estate_church_bishopric_of_osel_wiek }
		NOT = { has_estate_privilege = estate_church_bishopric_of_courland }
		NOT = { has_estate_privilege = estate_church_bishopric_of_reval }
	}
	on_revoked = {
	}
	penalties = {
		global_autonomy = 0.05
		global_manpower_modifier = -0.1
	}
	modifier_by_land_ownership = {
	}
	mechanics = {
		exempt_from_seize_land
	}
	on_granted = {
	}
	ai_will_do = {
		factor = -300
	}
}
estate_church_bishopric_of_dorpat = {
	icon = privilege_devotion_green
	max_absolutism = -20
	conditional_modifier = { trigger = { has_absolutism_reduction_for_estate_privileges = yes } modifier = { max_absolutism = 4 } }
	influence = 0.06
	land_share = 1
	loyalty = 0
	is_valid = {
		has_dlc = "Lions of the North"
		has_estate_privilege = estate_church_bishopric_of_dorpat
	}
	can_revoke = {
	}
	on_revoked = {
	}
	penalties = {
		global_tax_modifier = -0.2
	}
	modifier_by_land_ownership = {
	}
	mechanics = {
		exempt_from_seize_land
	}
	on_granted = {
	}
	ai_will_do = {
		factor = -300
	}
}
estate_church_bishopric_of_osel_wiek = {
	icon = privilege_devotion_yellow
	max_absolutism = -20
	conditional_modifier = { trigger = { has_absolutism_reduction_for_estate_privileges = yes } modifier = { max_absolutism = 4 } }
	influence = 0.06
	land_share = 1
	loyalty = 0
	is_valid = {
		has_dlc = "Lions of the North"
		has_estate_privilege = estate_church_bishopric_of_osel_wiek
	}
	can_revoke = {
	}
	on_revoked = {
	}
	penalties = {
		global_sailors_modifier = -0.15
	}
	modifier_by_land_ownership = {
	}
	mechanics = {
		exempt_from_seize_land
	}
	on_granted = {
	}
	ai_will_do = {
		factor = -300
	}
}
estate_church_bishopric_of_courland = {
	icon = privilege_devotion_purple
	max_absolutism = -20
	conditional_modifier = { trigger = { has_absolutism_reduction_for_estate_privileges = yes } modifier = { max_absolutism = 4 } }
	influence = 0.05
	land_share = 1
	loyalty = 0
	is_valid = {
		has_dlc = "Lions of the North"
		has_estate_privilege = estate_church_bishopric_of_courland
	}
	can_revoke = {
	}
	on_revoked = {
	}
	penalties = {
		fort_maintenance_modifier = 0.1
	}
	modifier_by_land_ownership = {
	}
	mechanics = {
		exempt_from_seize_land
	}
	on_granted = {
	}
	ai_will_do = {
		factor = -300
	}
}
estate_church_bishopric_of_reval = {
	icon = privilege_devotion_blue
	max_absolutism = -20
	conditional_modifier = { trigger = { has_absolutism_reduction_for_estate_privileges = yes } modifier = { max_absolutism = 4 } }
	influence = 0.05
	land_share = 1
	loyalty = 0
	is_valid = {
		has_dlc = "Lions of the North"
		has_estate_privilege = estate_church_bishopric_of_reval
	}
	can_revoke = {
	}
	on_revoked = {
	}
	penalties = {
		global_prov_trade_power_modifier = -0.15
	}
	modifier_by_land_ownership = {
	}
	mechanics = {
		exempt_from_seize_land
	}
	on_granted = {
	}
	ai_will_do = {
		factor = -300
	}
}

estate_church_japanese_christian_communities_privilege = {
	icon = estate_church_japanese_christian_communities_privilege
	max_absolutism = -5
	conditional_modifier = { trigger = { has_absolutism_reduction_for_estate_privileges = yes } modifier = { max_absolutism = 1 } }
	loyalty = 0.05
	influence = 0.05
	is_valid = {
		OR = { 
			has_estate_privilege = estate_church_japanese_christian_communities_privilege 
			has_country_flag = significant_christian_presence_flag
		}
	}
	can_select = {
		OR = { 
			has_estate_privilege = estate_church_japanese_christian_communities_privilege 
			custom_trigger_tooltip = {
				tooltip = generic_tt_has_access_to_this_privilege_tt
				has_country_flag = significant_christian_presence_flag
			}
		}
	}
	on_granted = {
	}
	penalties = {
	}
	benefits = {
		tolerance_heathen = 1 
		tolerance_heretic = 1 
		tolerance_own = 1 
	}
	ai_will_do = {
		factor = 1
	}
}

#Domination generic Estate Privileges
estate_church_development_of_temples = {
	icon = privilege_religious
	loyalty = 0.1
	influence = 0.05
	max_absolutism = -5
	conditional_modifier = { trigger = { has_absolutism_reduction_for_estate_privileges = yes } modifier = { max_absolutism = 1 } }
	is_valid = {
		has_dlc = "Domination"
	}
	on_granted = {
		custom_tooltip = estate_church_development_of_temples_gt
		tooltip = {
			add_province_modifier = {
				name = estate_church_development_of_temples_mod
				duration = -1
			}
		}
	}
	on_revoked = {
		custom_tooltip = estate_church_development_of_temples_rt
	}
	on_granted_province = {
		if = {
			limit = {
				OR = {
					has_owner_religion = yes
					has_owner_harmonized_religion = yes
					has_owner_secondary_religion = yes
				}
				has_tax_building_trigger = yes
			}
			add_province_modifier = {
				name = estate_church_development_of_temples_mod
				duration = -1
			}
		}
	}
	on_invalid_province = {
		if = {
			limit = { has_province_modifier = estate_church_development_of_temples_mod }
			remove_province_modifier = estate_church_development_of_temples_mod
		}
	}
	on_revoked_province = {
		if = {
			limit = { has_province_modifier = estate_church_development_of_temples_mod }
			remove_province_modifier = estate_church_development_of_temples_mod
		}
	}

	mechanics = {
		no_estate_crownland_loss_from_developing
	}
	conditional_modifier = {
		trigger = { has_government_mechanic = russian_modernization_mechanic }
		modifier = { monthly_russian_modernization = -0.03 }
	}
	#conditional_modifier = {
	#	trigger = { has_government_mechanic = ottoman_decadence_mechanic }
	#	modifier = { monthly_ottoman_decadence = 0.02 }
	#}
	ai_will_do = {
		factor = 0
	}
}
estate_church_expand_the_theology = {
	icon = privilege_missionary
	loyalty = 0.0
	influence = 0.05
	max_absolutism = -5
	conditional_modifier = { trigger = { has_absolutism_reduction_for_estate_privileges = yes } modifier = { max_absolutism = 1 } }
	is_valid = {
		has_dlc = "Domination"
	}
	can_select = {
		if = {
			limit = { has_estate = estate_brahmins }
			NOT = { has_estate_privilege = estate_brahmins_expand_the_theology }
		}
	}
	on_granted = {
		enable_estate_action = {
			estate_action = RECRUIT_MINISTER_CHURCH
		}
		custom_tooltip = empty_text
		enable_estate_action = {
			estate_action = RECRUIT_INQUISITOR_CHURCH
		}
	}
	on_revoked = {
		disable_estate_action = {
			estate_action = RECRUIT_MINISTER_CHURCH
		}
		custom_tooltip = empty_text
		disable_estate_action = {
			estate_action = RECRUIT_INQUISITOR_CHURCH
		}
	}
	on_invalid = {
		disable_estate_action = {
			estate_action = RECRUIT_MINISTER_CHURCH
		}
		disable_estate_action = {
			estate_action = RECRUIT_INQUISITOR_CHURCH
		}
	}
	conditional_modifier = {
		trigger = { has_government_mechanic = russian_modernization_mechanic }
		modifier = { monthly_russian_modernization = -0.03 }
	}
	influence_scaled_conditional_modifier = {
		trigger = {
			has_country_flag = ned_buff_clerical_studies
		}
		modifier = {
			tolerance_heretic = 2
			relation_with_heretics = 30
		}
	}
	ai_will_do = {
		factor = 0
	}
}
estate_church_clerical_education = {
	icon = privilege_technology
	loyalty = 0.0
	influence = 0.05
	max_absolutism = -5
	conditional_modifier = { trigger = { has_absolutism_reduction_for_estate_privileges = yes } modifier = { max_absolutism = 1 } }
	is_valid = {
		has_dlc = "Domination"
	}
	can_select = {
		if = {
			limit = { has_estate = estate_brahmins }
			NOT = { has_estate_privilege = estate_brahmins_clerical_education }
		}
		if = {
			limit = { has_estate = estate_dhimmi }
			NOT = { has_estate_privilege = estate_dhimmi_dhimmi_education }
		}
	}
	on_granted = {
		scaling_with_influence_privilege_tooltip = {
			estate_privilege = estate_church_clerical_education
		}
	}
	on_revoked = {
		scaling_with_influence_privilege_tooltip = {
			estate_privilege = estate_church_clerical_education
		}
	}
	influence_scaled_conditional_modifier = {	#Modifier that are applied if the specified conditions are true. At 100% Influence you gain 100% of the modifier.
		trigger = {
			NOT = {
				estate_loyalty = {
					estate = estate_church
					loyalty = 30
				}
			}
		}
		modifier = {
			reform_progress_growth = -0.25
		}
	}
	influence_scaled_conditional_modifier = {	#Modifier that are applied if the specified conditions are true. At 100% Influence you gain 100% of the modifier.
		trigger = {
			estate_loyalty = {
				estate = estate_church
				loyalty = 30
			}
			NOT = {
				estate_loyalty = {
					estate = estate_church
					loyalty = 60
				}
			}
		}
		modifier = {
			reform_progress_growth = 0.1
		}
	}
	influence_scaled_conditional_modifier = {	#Modifier that are applied if the specified conditions are true. At 100% Influence you gain 100% of the modifier.
		trigger = {
			estate_loyalty = {
				estate = estate_church
				loyalty = 60
			}
		}
		modifier = {
			reform_progress_growth = 0.25
		}
	}
	conditional_modifier = {
		trigger = { has_government_mechanic = russian_modernization_mechanic }
		modifier = { monthly_russian_modernization = -0.03 }
	}
	#conditional_modifier = {
	#	trigger = { has_government_mechanic = ottoman_decadence_mechanic }
	#	modifier = { monthly_ottoman_decadence = 0.02 }
	#}
	ai_will_do = {
		factor = 100
		modifier = {
			factor = 0.5
			is_absolutism_active = yes
		}
	}
}
estate_church_religious_delegation = {
	icon = privilege_tolerance_own
	loyalty = 0.0
	influence = 0.05
	max_absolutism = -5
	conditional_modifier = { trigger = { has_absolutism_reduction_for_estate_privileges = yes } modifier = { max_absolutism = 1 } }
	is_valid = {
		has_dlc = "Domination"
	}
	on_granted = {
		enable_estate_action = {
			estate_action = RELIGIOUS_DELEGATION_CHURCH
		}
	}
	on_revoked = {
		disable_estate_action = {
			estate_action = RELIGIOUS_DELEGATION_CHURCH
		}
	}
	on_invalid = {
		disable_estate_action = {
			estate_action = RELIGIOUS_DELEGATION_CHURCH
		}
	}
	conditional_modifier = {
		trigger = { has_government_mechanic = russian_modernization_mechanic }
		modifier = { monthly_russian_modernization = -0.03 }
	}
	#conditional_modifier = {
	#	trigger = { has_government_mechanic = ottoman_decadence_mechanic }
	#	modifier = { monthly_ottoman_decadence = 0.02 }
	#}
	ai_will_do = {
		factor = 10
		modifier = {
			factor = 0.1
			is_absolutism_active = yes
		}
	}
}
estate_church_institutionalized_clergy = {
	icon = privilege_government
	loyalty = 0.0
	influence = 0.05
	max_absolutism = -5
	conditional_modifier = { trigger = { has_absolutism_reduction_for_estate_privileges = yes } modifier = { max_absolutism = 1 } }
	is_valid = {
		has_dlc = "Domination"
	}
	conditional_modifier = {
		trigger = {
			has_country_flag = MAY_upgrade_institutionalized_clergy_privilege_flag
		}
		modifier = {
			religious_unity = 0.1
		}
	}
	on_granted = {
		enable_estate_action = {
			estate_action = SEEK_SUPPORT_OF_CLERGY_CHURCH
		}
	}
	on_invalid = {
		disable_estate_action = {
			estate_action = SEEK_SUPPORT_OF_CLERGY_CHURCH
		}
	}
	on_revoked = {
		disable_estate_action = {
			estate_action = SEEK_SUPPORT_OF_CLERGY_CHURCH
		}
	}
	conditional_modifier = {
		trigger = { has_government_mechanic = russian_modernization_mechanic }
		modifier = { monthly_russian_modernization = -0.03 }
	}
	#conditional_modifier = {
	#	trigger = { has_government_mechanic = ottoman_decadence_mechanic }
	#	modifier = { monthly_ottoman_decadence = 0.02 }
	#}
	ai_will_do = {
		factor = 1
		modifier = {
			factor = 0.1
			is_absolutism_active = yes
		}
	}
}
estate_church_donation_right = {
	icon = privilege_make_generous_donation
	loyalty = 0.0
	influence = 0.05
	max_absolutism = -5
	conditional_modifier = { trigger = { has_absolutism_reduction_for_estate_privileges = yes } modifier = { max_absolutism = 1 } }
	is_valid = {
		has_dlc = "Domination"
	}
	loyalty_scaled_conditional_modifier = {
		trigger = {
			always = yes
		}
		modifier = {
			missionary_maintenance_cost = -1
			prestige_per_development_from_conversion = 0.5
		}
	}
	on_granted = {
		scaling_with_loyalty_privilege_tooltip = {
			estate_privilege = estate_church_donation_right
		}
		enable_estate_action = {
			estate_action = MAKE_GENEROUS_DONATION_CHURCH
		}
	}
	on_invalid = {
		scaling_with_loyalty_privilege_tooltip = {
			estate_privilege = estate_church_donation_right
		}
		disable_estate_action = {
			estate_action = MAKE_GENEROUS_DONATION_CHURCH
		}
	}
	on_revoked = {
		scaling_with_loyalty_privilege_tooltip = {
			estate_privilege = estate_church_donation_right
		}
		disable_estate_action = {
			estate_action = MAKE_GENEROUS_DONATION_CHURCH
		}
	}
	conditional_modifier = {
		trigger = { has_government_mechanic = russian_modernization_mechanic }
		modifier = { monthly_russian_modernization = -0.03 }
	}
	#conditional_modifier = {
	#	trigger = { has_government_mechanic = ottoman_decadence_mechanic }
	#	modifier = { monthly_ottoman_decadence = 0.02 }
	#}
	ai_will_do = {
		factor = 10
		modifier = {
			factor = 0.1
			is_absolutism_active = yes
		}
	}
}

#Byzantium
estate_church_BYZ_legitimization_of_dynasty = {
	icon = estate_church_BYZ_legitimization_of_dynasty 
	loyalty = 0.05
	influence = 0.1
	max_absolutism = 10
	is_valid = {
		tag = BYZ
		has_country_flag = BYZ_privilege_for_support_of_dynasty
	}
	on_granted = {
		custom_tooltip = BYZ_if_above_33_patriarch_authority
	}
	conditional_modifier = {
		trigger = {
			patriarch_authority = 0.33
		}
		modifier = {
			global_autonomy = -0.1
			legitimacy = 1
			tolerance_own = 1
		}
	}
	conditional_modifier = {
		trigger = {
			patriarch_authority = 0.33
		}
		is_bad = yes
		modifier = {
			yearly_patriarch_authority = -0.01
		}
	}
	ai_will_do = {
		factor = 5 #good privilege for the AI
	}
}

estate_church_union_of_the_churches = {
	icon = estate_church_union_of_the_churches
	loyalty = -0.1
	influence = 0
	max_absolutism = -10
	conditional_modifier = { trigger = { has_absolutism_reduction_for_estate_privileges = yes } modifier = { max_absolutism = 2 } }
	is_valid = {
		OR = {
			tag = BYZ
			has_estate_privilege = estate_church_union_of_the_churches
		}
		NOT = { has_country_flag = estate_church_union_of_the_churches_removed }
	}
	can_revoke = {
		custom_trigger_tooltip = {
			tooltip = BYZ_revokable_via_decision
			always = no
		}
	}
	on_granted = {
		# custom_tooltip = BYZ_may_not_convert_catholics
		
		# custom_tooltip = " "
		
		custom_tooltip = BYZ_may_cause_unionist_revolts
		
		hidden_effect = {
			PAP = {
				add_opinion = {
					who = ROOT
					modifier = BYZ_union_of_the_churches_op
				}
			}
		}
	}
	conditional_modifier = {
		trigger = {
			religion = orthodox
		}
		modifier = {
			tolerance_heretic = 1
			tolerance_own = -4
			global_heretic_missionary_strength = -0.1
		}
	}
	conditional_modifier = {
		trigger = {
			religion = catholic
		}
		modifier = {
			tolerance_heretic = -4
			tolerance_own = -1
			global_heretic_missionary_strength = -0.03
		}
	}
	benefits = {
		
	}
	penalties = {
		
	}
	conditional_modifier = {
		trigger = {
			has_country_modifier = BYZ_extra_mercenary_cost_for_union
		}
		modifier = {
			mercenary_cost = -0.15
		}
	}
	on_revoked = {
		PAP = {
			remove_opinion = {
				who = ROOT
				modifier = BYZ_union_of_the_churches_op
			}
		}
		set_country_flag = estate_church_union_of_the_churches_removed
	}	
	on_invalid = {
		PAP = {
			remove_opinion = {
				who = ROOT
				modifier = BYZ_union_of_the_churches_op
			}
		}
	}
	ai_will_do = {
		factor = 0
	}
}
estate_church_muslim_integration = {
	icon = privilege_send_emissary_to_pope
	loyalty = 0
	influence = 0.05
	max_absolutism = -10
	conditional_modifier = { trigger = { has_absolutism_reduction_for_estate_privileges = yes } modifier = { max_absolutism = 2 } }
	is_valid = {
		has_unlocked_estate_privilege = { estate_privilege = estate_church_muslim_integration }
		any_owned_province = {
			religion_group = muslim
		}
		NOT = { religion_group = muslim }
	}
	on_granted = {
		custom_tooltip = estate_church_muslim_integration_gt
		tooltip = {
			add_province_modifier = {
				name = estate_church_muslim_integration_mod
				duration = -1
				desc = UNTIL_REVOKED
			}
		}
	}
	on_granted_province = {
		if = {
			limit = { religion_group = muslim }
			add_province_modifier = {
				name = estate_church_muslim_integration_mod
				duration = -1
				desc = UNTIL_REVOKED
			}
		}
	}
	on_revoked = {
		custom_tooltip = estate_church_muslim_integration_rt
	}
	on_revoked_province = {
		remove_province_modifier = estate_church_muslim_integration_mod
	}
	on_invalid = {
		custom_tooltip = estate_church_muslim_integration_rt
	}
	on_invalid_province = {
		remove_province_modifier = estate_church_muslim_integration_mod
	}
	benefits = {
		church_privilege_slots = 1
	}
	penalties = {
	}
	ai_will_do = {
		factor = 0
	}
}

#1.36
estate_church_fund_dar_al_hadith = {
	icon = estate_church_fund_dar_al_hadith
	max_absolutism = -5
	conditional_modifier = { trigger = { has_absolutism_reduction_for_estate_privileges = yes } modifier = { max_absolutism = 1 } }
	loyalty = 0.1
	influence = 0.1
	is_valid = {
		is_or_was_tag = { tag = MAM }
		has_dlc = "King of Kings"
	}
	benefits = {
		same_religion_advisor_cost = -0.1
	}
	modifier_by_land_ownership = {
		global_tax_modifier = -0.25
		technology_cost = -0.1
	}
	ai_will_do = {
		factor = 10
	}
}

estate_church_fund_madrasas = {
	icon = estate_church_fund_madrasas
	max_absolutism = -10
	conditional_modifier = { trigger = { has_absolutism_reduction_for_estate_privileges = yes } modifier = { max_absolutism = 2 } }
	land_share = 5
	loyalty = 0.05
	influence = 0.05
	is_valid = {
		is_or_was_tag = { tag = MAM }
		has_dlc = "King of Kings"
	}
	on_granted = {

	}
	penalties = {
	}
	benefits = {
		yearly_innovativeness = 0.1
		missionaries = 1
	}
	ai_will_do = {
		factor = 10
	}
}

estate_church_sponsor_waqf_payments = {
	icon = estate_church_sponsor_waqf_payments 
	max_absolutism = -5
	conditional_modifier = { trigger = { has_absolutism_reduction_for_estate_privileges = yes } modifier = { max_absolutism = 1 } }
	land_share = 5
	loyalty = 0.1
	influence = 0.15
	is_valid = {
		is_or_was_tag = { tag = MAM }
		religion_group = muslim
	}
	on_granted = {

	}
	conditional_modifier = {
		
	}
	penalties = {
	}
	benefits = {
		tolerance_own = 1
		stability_cost_modifier = -0.25
		establish_order_cost = -0.1
	}
	ai_will_do = {
		factor = 10
	}
}

estate_church_INC_idol_making = {
	icon = privilege_golden_idols
	max_absolutism = -5
	conditional_modifier = {
		trigger = {
			has_absolutism_reduction_for_estate_privileges = yes 
		} 
		modifier = { max_absolutism = 1 } 
	}
	conditional_modifier = {
		trigger = {
			has_country_flag = INC_upgrade_idol_estate_privilege_flag
		} 
		modifier = { max_absolutism = 5 } 
	}
	influence = 0
	loyalty = 0.1
	is_valid = {
		has_country_flag = INC_unlock_the_idol_privilege_flag
	}
	can_select = {
		trade_goods_produced_amount = {
			trade_goods = gold
			amount = 1
		}
	}
	on_granted = {
		custom_tooltip = INC_every_gold_province
		tooltip = {
			add_province_modifier = {
				name = INC_gold_debuff
				duration = -1
			}
		}
	}
	on_granted_province = {
		if = {
			limit = {
				trade_goods = gold 
			}
			add_province_modifier = {
				name = INC_gold_debuff
				duration = -1
			}
		}
	}
	on_revoked = {
		custom_tooltip = INC_gold_income_return_to_normal
		hidden_effect = { 
			every_owned_province = {
				remove_province_modifier = INC_gold_debuff
			}
		}
	}
	on_invalid = {
		custom_tooltip = INC_gold_income_return_to_normal
		hidden_effect = { 
			every_owned_province = {
				remove_province_modifier = INC_gold_debuff
			}
		}
	}
	conditional_modifier = {
		trigger = {
			NOT = { has_country_flag = INC_upgrade_idol_estate_privilege_flag }
		}
		modifier = {
			monthly_divine_authority = 0.05
			yearly_authority = 0.5
			tolerance_own = 1
			same_religion_advisor_cost = -0.1
		}
	}
	conditional_modifier = {
		trigger = {
			has_country_flag = INC_upgrade_idol_estate_privilege_flag 
		}
		modifier = {
			monthly_divine_authority = 0.1
			yearly_authority = 1
			tolerance_own = 2
			same_religion_advisor_cost = -0.2
		}
	}
	ai_will_do = {
		factor = 100
		modifier = {
			factor = 0
			is_absolutism_active = yes
		}
	}
}

estate_church_MAY_cocoa_monopoly = {
	icon = privilege_monopoly_of_cocoa
	loyalty = 0.1
	influence = 0
	max_absolutism = -10
	conditional_modifier = { trigger = { has_absolutism_reduction_for_estate_privileges = yes } modifier = { max_absolutism = 2 } }
	is_valid = {
		has_country_flag = MAY_cocoa_monopoly_flag
		any_owned_province = {
			trade_goods = cocoa
		}
	}
	on_granted = {
		if = {
			limit = {
				cocoa = 1
			}
			add_mercantilism = 1
		}
		add_years_of_owned_provinces_production_income = {
			years = 12
			trigger = {
				trade_goods = cocoa
			}
			custom_tooltip = MAY_MONOPOLY_COCOA_FROM_COCOA
		}
		custom_tooltip = estate_church_MAY_cocoa_monopoly_effect_tooltip
	}
	on_granted_province = {
		if = {
			limit = {
				trade_goods = cocoa
			}
			add_province_modifier = {
				name = estate_church_MAY_cocoa_monopoly_mod
				duration = -1
			}
		}
		else_if = {
			limit = {
				has_province_modifier = estate_church_MAY_cocoa_monopoly_mod
			}
			remove_province_modifier = estate_church_MAY_cocoa_monopoly_mod
		}
	}
	on_revoked = {
		custom_tooltip = estate_church_MAY_cocoa_monopoly_revoke_tooltip
	}
	on_revoked_province = {
		if = {
			limit = {
				has_province_modifier = estate_church_MAY_cocoa_monopoly_mod
			}
			remove_province_modifier = estate_church_MAY_cocoa_monopoly_mod
		}
	}
	on_invalid = {
		custom_tooltip = estate_church_MAY_cocoa_monopoly_revoke_tooltip
	}
	on_invalid_province = {
		if = {
			limit = {
				has_province_modifier = estate_church_MAY_cocoa_monopoly_mod
			}
			remove_province_modifier = estate_church_MAY_cocoa_monopoly_mod
		}
	}
	penalties = {
	}
	benefits = {
	}
	cooldown_years = 10
	conditional_modifier = {
		trigger = {
			has_country_flag = buffed_monopolies
		}
		modifier = {
			max_absolutism = 10
			church_privilege_slots = 1
		}
	}
	on_cooldown_expires = {
		country_event = { id = flavor_may.9 }
	}
	ai_will_do = {
		factor = 1
	}
}

estate_church_religious_tolerance = {
	icon = privilege_nomadic_tolerance
	max_absolutism = -10
	conditional_modifier = { trigger = { has_absolutism_reduction_for_estate_privileges = yes } modifier = { max_absolutism = 2 } }
	loyalty = 0.05
	influence = 0.1
	is_valid = {
		has_country_flag = hordes_religious_tolerance_tribal_privilege_flag
	}
	can_select = {
		NOT = { has_estate_privilege = estate_nomadic_tribes_religious_tolerance }
	}
	loyalty_scaled_conditional_modifier = {
		trigger = { always = yes }
		modifier = {
			tolerance_heathen = 1
			tolerance_heretic = 1
		}
	}
	ai_will_do = {
		factor = 0
	}
}

estate_church_TIM_yasa_supremacy = {
	icon = privilege_aged_paper
	max_absolutism = 0
	influence = 0.0
	loyalty = -0.1
	is_valid = {
		OR = {
			tag = TIM
			was_tag = TIM
		}
		NOT = { has_country_flag = estate_church_TIM_yasa_supremacy_revoked }
	}
	penalties = {
		tolerance_own = -1
		religious_unity = -0.15
	}
	benefits = {
		cavalry_power = 0.05
		nobles_influence_modifier = 0.05
	}
	can_revoke = {
		custom_trigger_tooltip = {
			tooltip = BYZ_revokable_via_decision
			always = no
		}
	}
	ai_will_do = {
		factor = 0
	}
}

estate_church_TIM_promote_ijazah = {
	icon = estate_church_fund_dar_al_hadith
	max_absolutism = -5
	conditional_modifier = { trigger = { has_absolutism_reduction_for_estate_privileges = yes } modifier = { max_absolutism = 1 } }
	influence = 0.05
	loyalty = 0.1
	land_share = 3
	is_valid = {
		has_country_flag = TIM_unlock_privilege_for_innovativeness_gain_flag
	}
	mechanics = {
		exempt_from_seize_land
	}
	loyalty_scaled_conditional_modifier = {
		trigger = {
			always = yes
		}
		modifier = {
			yearly_innovativeness = 0.5
		}
	}
	on_granted = {
		scaling_with_loyalty_privilege_tooltip = {
			estate_privilege = estate_church_TIM_promote_ijazah
		}
	}
	ai_will_do = {
		factor = 1
	}
}

estate_church_MUG_promote_divine_religion = {
	icon = privilege_legitimacy
	loyalty = -0.1
	max_absolutism = 10
	is_valid = {
		has_country_flag = MUG_promote_din_i_ilahi_flag
	}
	penalties = {
		religious_unity = -0.1
	}
	benefits = {
		yearly_absolutism = 1
	}
	
	ai_will_do = {
		factor = 0 #AI will not be able to handle this
	}
}