estate_nobles_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 = {
		not = { has_estate_privilege = estate_ghulams_land_rights }
		not = { has_estate_privilege = estate_qizilbash_land_rights }
	}
	on_granted = {
	}
	penalties = {
	}
	conditional_modifier = {
		trigger = { has_country_flag = mng_increased_land_rights_flag }
		modifier = {
			stability_cost_modifier = -0.05
		}
	}
	conditional_modifier = {
		trigger = { has_government_attribute = BYZ_buff_dynatoi_land_grants  }
		modifier = {
			land_forcelimit_modifier = 0.1
			max_absolutism = 5
		}
	}

	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.05 }
	}
	#conditional_modifier = {
	#	trigger = { has_government_mechanic = ottoman_decadence_mechanic }
	#	modifier = { monthly_ottoman_decadence = 0.02 }
	#}
	ai_will_do = {
		factor = 5
		#LIMIT
		modifier = {
			factor = 0
			OR = {
				NOT = { crown_land_share = 25 }
				estate_influence = {
					estate = estate_nobles
					influence = 75
				}
			}
			NOT = { has_estate_privilege = estate_nobles_land_rights }
		}
		modifier = {
			factor = 0
			AND = {
				NOT = { num_of_territories = 1 }
				NOT = { has_estate_privilege = estate_nobles_land_rights }
			}
		}
		#GOVERNING CAPACITY
		modifier = {
			factor = 0.1
			NOT = { governing_capacity_percentage = 0.4 }
		}
		modifier = {
			factor = 0.4
			NOT = { governing_capacity_percentage = 0.5 }
		}
		modifier = {
			factor = 0.6
			NOT = { governing_capacity_percentage = 0.6 }
		}
		modifier = {
			factor = 0.8
			NOT = { governing_capacity_percentage = 0.7 }
		}
		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_nobles_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_nobles_land_rights }
		}
		modifier = {
			factor = 0.9
			is_absolutism_active = yes
		}
		#POTENTIAL
		modifier = {
			factor = 1.5
			num_of_territories = 10
		}
		modifier = {
			factor = 1.5
			total_development = 400
		}
		modifier = {
			factor = 1.5
			total_development = 600
		}
		modifier = {
			factor = 1.5
			total_development = 800
		}
		modifier = {
			factor = 1.5
			total_development = 1000
		}
		modifier = {
			factor = 2.0
			government_rank = 2
		}
		modifier = {
			factor = 3.0
			government_rank = 3
		}
		modifier = {
			factor = 3.0
			has_estate_privilege = estate_nobles_land_rights
		}
		#GOVERNING CAPACITY
		modifier = {
			factor = 3.0
			governing_capacity_percentage = 0.9
		}
		modifier = {
			factor = 3.5
			governing_capacity_percentage = 1.0
		}
		modifier = {
			factor = 5.0
			governing_capacity_percentage = 1.1
		}
	}
}

estate_nobles_nobility_primacy = {
	icon = privilege_military_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_nobles
			type = mil
		}
	}
	on_granted = {
	}
	penalties = {
	}
	benefits = {
		country_military_power = 1
	}
	conditional_modifier = {
		trigger = { has_government_mechanic = russian_modernization_mechanic }
		modifier = { monthly_russian_modernization = -0.05 }
	}
	conditional_modifier = {
		trigger = { has_country_flag = GER_upgrade_primacy_of_the_nobility_flag }
		modifier = { mil_tech_cost_modifier = -0.1 }
	}
	conditional_modifier = {
		trigger = { has_country_flag = azt_imperial_tributes_flag }
		modifier = { monarch_power_tribute = 1 }
	}
	ai_will_do = {
		factor = 100
		modifier = {
			factor = 0
			OR = {
				NOT = { crown_land_share = 20 }
				estate_influence = {
					estate = estate_nobles
					influence = 95
				}
			}
			NOT = { has_estate_privilege = estate_nobles_nobility_primacy }
		}
		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_nobles_nobility_primacy }
		}
		modifier = {
			factor = 0.8
			is_absolutism_active = yes
		}
		modifier = {
			factor = 1.25
			NOT = { mil = 2 }
		}
		modifier = {
			factor = 1000
			has_mission = kon_reform_army
			NOT = { mission_completed = kon_reform_army }
		}
	}
}

estate_nobles_officer_corp = {
	icon = privilege_promote_purbias
	max_absolutism = -5
	conditional_modifier = { trigger = { has_absolutism_reduction_for_estate_privileges = yes } modifier = { max_absolutism = 1 } }
	influence = 0.05
	is_valid = {
		NOT = { has_estate = estate_qizilbash }
	}
	can_select = {
		if = {
			limit = {
				NOT = { has_country_flag = azt_free_officer_corp_flag }
			}
			army_tradition = 30
		}
	}
	on_granted = {
		if = {
			limit = {
				NOT = { has_country_flag = azt_free_officer_corp_flag }
			}
			add_army_tradition = -5
		}
		if = {
			limit = {
				has_country_flag = hab_military_reform_flag
			}
			custom_tooltip = HAB_WHEN_AT_WAR_GRANT_MORALE
		}
	}
	penalties = {
	}
	benefits = {
		army_tradition_decay = -0.005
	}
	conditional_modifier = {
		trigger = { 
			NOT = { has_country_flag = TIM_upgrade_amirs_in_officer_corps_mission_flag }
		}
		modifier = {
			general_cost = -0.1
		}
	}
	conditional_modifier = {
		trigger = { has_country_flag = TIM_upgrade_amirs_in_officer_corps_mission_flag }
		modifier = {
			general_cost = -0.2
			movement_speed = 0.05
		}
	}
	conditional_modifier = {
		trigger = { has_government_mechanic = russian_modernization_mechanic }
		modifier = { monthly_russian_modernization = -0.05 }
	}
	conditional_modifier = {
		trigger = { has_country_flag = feo_buff_nobility_officer_corp_flag }
		modifier = { global_regiment_cost = -0.1 }
	}
	conditional_modifier = {
		trigger = { 
			has_country_flag = hab_military_reform_flag
			is_at_war = yes 
		}
		modifier = { land_morale = 0.1 }
	}
	ai_will_do = {
		factor = 0
	}
}

estate_nobles_levies = {
	icon = privilege_demand_more_troops
	max_absolutism = -5
	conditional_modifier = { trigger = { has_absolutism_reduction_for_estate_privileges = yes NOT = { has_government_attribute = free_noble_levies } } modifier = { max_absolutism = 1 } }
	influence = 0.1
	loyalty = 0.1
	is_valid = {
		NOT = { has_estate_privilege = estate_nobles_golden_liberty }
		NOT = { has_estate = estate_ghulams }
	}
	can_select = {
		NOT = { has_estate_privilege = estate_nobles_golden_liberty }
		if = {
			limit = {
				has_estate = estate_maratha
			}
			NOT = { has_estate_privilege = estate_maratha_levies }
		}
		if = {
			limit = {
				has_estate = estate_maratha
			}
			NOT = { has_estate_privilege = estate_maratha_levies_for_muslims }
		}
	}
	on_granted = {
		if = {
			limit = { has_country_flag = azt_noble_levies_loyalty_buff_flag }
			custom_tooltip = azt_estate_nobles_levies_scaled_modifier_tt
		}
	} 
	modifier_by_land_ownership = {
		global_tax_modifier = -0.10
		global_manpower_modifier = 0.5
	}
	influence_scaled_conditional_modifier = {
		trigger = {
			has_country_flag = azt_buff_noble_levies_flag
		}
		modifier = {
			global_regiment_cost = -0.1
		}
	}
	loyalty_scaled_conditional_modifier = {
		trigger = {
			has_country_flag = azt_noble_levies_loyalty_buff_flag
		}
		modifier = {
			global_manpower_modifier = 0.15
		}
	}
	penalties = {
	}
	mechanics = {
		exempt_from_seize_land
	}
	conditional_modifier = {
		trigger = {
			has_government_attribute = free_noble_levies
		}
		modifier = {
			max_absolutism = 5
			nobles_influence_modifier = -0.1
		}
	}
	conditional_modifier = {
		trigger = { has_government_mechanic = russian_modernization_mechanic }
		modifier = { monthly_russian_modernization = -0.05 }
	}
	#conditional_modifier = {
	#	trigger = { has_government_mechanic = ottoman_decadence_mechanic }
	#	modifier = { monthly_ottoman_decadence = 0.02 }
	#}
	ai_will_do = {
		factor = 14.0
		modifier = {
			factor = 1.5
			any_rival_country = {
				army_strength = {
					who = ROOT
					value = 1.5
				}
			}
		}
		modifier = {
			factor = 2
			has_idea_group = quantity_ideas
		}
		modifier = {
			factor = 1.5
			NOT = { max_manpower = 40 }
		}
		modifier = {
			factor = 0.5
			max_manpower = 200
		}
		modifier = {
			factor = 2
			estate_territory = {
				estate = estate_nobles
				territory = 50
			}
		}
		modifier = {
			factor = 1.5
			estate_territory = {
				estate = estate_nobles
				territory = 40
			}
		}
		modifier = {
			factor = 1.5
			estate_territory = {
				estate = estate_nobles
				territory = 30
			}
		}
		modifier = {
			factor = 0.5
			NOT = {
				estate_territory = {
					estate = estate_nobles
					territory = 15
				}
			}
		}
		modifier = {
			factor = 0.5
			NOT = {
				estate_territory = {
					estate = estate_nobles
					territory = 10
				}
			}
		}
		modifier = {
			factor = 0.5
			NOT = {
				estate_territory = {
					estate = estate_nobles
					territory = 5
				}
			}
		}
		modifier = {
			factor = 0.75
			NOT = { current_income_balance = 5 }
		}
		modifier = {
			factor = 0.75
			NOT = { current_income_balance = 0 }
		}
		modifier = {
			factor = 0
			is_absolutism_active = yes
		}
	}
}

estate_nobles_advisors = {
	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.05
	penalties = {
		stability_cost_modifier = 0.1
	}
	can_select = { 
		NOT = { has_estate_privilege = estate_maratha_advisor }
		NOT = { has_estate_privilege = estate_rajput_advisor }
	}
	benefits = {
		mil_advisor_cost = -0.15
	}
	conditional_modifier = {
		trigger = { has_government_mechanic = russian_modernization_mechanic }
		modifier = { monthly_russian_modernization = -0.05 }
	}
	#conditional_modifier = {
	#	trigger = { has_government_mechanic = ottoman_decadence_mechanic }
	#	modifier = { monthly_ottoman_decadence = 0.02 }
	#}
	ai_will_do = {
		factor = 25
		modifier = {
			factor = 0
			estate_influence = {
				estate = estate_nobles
				influence = 80
			}			
		}
		modifier = {
			factor = 0.5
			is_absolutism_active = yes
		}
		modifier = {
			factor = 3
			uses_meritocracy = yes
		}
	}
}

estate_nobles_right_of_counsel = {
	icon = privilege_royal_authority
	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.05 }
	}
	#conditional_modifier = {
	#	trigger = { has_government_mechanic = ottoman_decadence_mechanic }
	#	modifier = { monthly_ottoman_decadence = 0.02 }
	#}
	ai_will_do = {
		factor = 1
		modifier = {
			factor = 0
			is_absolutism_active = yes
		}
	}
}

estate_nobles_french_strong_duchies = {
	icon = privilege_french_strong_duchies
	max_absolutism = -10
	conditional_modifier = { trigger = { has_absolutism_reduction_for_estate_privileges = yes } modifier = { max_absolutism = 2 } }
	loyalty = 0.1
	influence = 0.1
	check_valid_when_tag_switching = no
	is_valid = {
		OR = {
			has_estate_privilege = estate_nobles_french_strong_duchies
			AND = {
				tag = FRA
				NOT = { has_estate_privilege = estate_nobles_strong_duchies }
			}
		}
		any_subject_country = {
			OR = {
				is_subject_of_type = appanage
				is_subject_of_type = vassal
				is_subject_of_type = march
				is_subject_of_type = client_march
				is_subject_of_type = client_vassal
				is_subject_of_type = personal_union
			}
			capital_scope = { region = france_region }
			culture_group = french
		}
	}
	can_select = {
		custom_trigger_tooltip = {
			tooltip = estate_nobles_strong_duchies_trigger_tooltip
			calc_true_if = {
				amount = 2
				all_subject_country = {
					OR = {
						is_subject_of_type = appanage
						is_subject_of_type = vassal
						is_subject_of_type = march
						is_subject_of_type = client_march
						is_subject_of_type = client_vassal
						is_subject_of_type = personal_union
						is_subject_of_type = incorporated_vassal
						is_subject_of_type = integrated_personal_union
					}
				}
			}
		}
		NOT = { has_estate_privilege = estate_eunuchs_delegate_subject_diplomacy_privilege }
	}
	penalties = {
	}
	benefits = {
		diplomatic_upkeep = 3
		reduced_liberty_desire_on_same_continent = 10
	}
	conditional_modifier = {
		trigger = { has_government_attribute = buffed_strong_duchies }
		modifier = {
			nobles_loyalty_modifier = 0.05
		}
	}
	ai_will_do = {
		factor = 1000
		modifier = {
			factor = 3
			calc_true_if = {
				amount = 1
				all_subject_country = {
					OR = {
						is_march = yes
						is_vassal = yes
					}
				}
			}
		}
		modifier = {
			factor = 2
			calc_true_if = {
				amount = 2
				all_subject_country = {
					OR = {
						is_march = yes
						is_vassal = yes
					}
				}
			}
		}
	}
}


#DLC Privileges

estate_nobles_supremacy_over_crown = {
	icon = privilege_empty_throne
	max_absolutism = -5
	conditional_modifier = { trigger = { has_absolutism_reduction_for_estate_privileges = yes } modifier = { max_absolutism = 1 } }
	influence = 0.0
	loyalty = 0.0
	is_valid = {
		has_dlc = "Emperor"
		NOT = { has_government_attribute = blocked_call_diet }
	}
	can_select = { 
		NOT = { has_estate_privilege = estate_eunuchs_supremacy_over_crown_privilege }
	}
	penalties = {
	}
	benefits = {
		all_estate_loyalty_equilibrium = 0.1
		all_estate_influence_modifier = 0.1
	}
	loyalty_scaled_conditional_modifier = {
		trigger = {
			has_country_flag = hab_second_option_flag
			estate_influence = {
				estate = estate_nobles
				influence = 80
			}
		}
		modifier = {
			global_manpower_modifier = 0.2
		}
	}
	mechanics = {
		can_give_agendas_without_interaction
	}
	conditional_modifier = {
		trigger = { has_government_mechanic = russian_modernization_mechanic }
		modifier = { monthly_russian_modernization = -0.05 }
	}
	#conditional_modifier = {
	#	trigger = { has_government_mechanic = ottoman_decadence_mechanic }
	#	modifier = { monthly_ottoman_decadence = 0.02 }
	#}
	ai_will_do = {
		factor = 0
	}
}

estate_nobles_monopoly_of_metals = {
	icon = privilege_monopoly_of_goods_iron
	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 = {
			OR = {
				trade_goods = iron
				trade_goods = copper
			}
		}
	}
	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 = {
				OR = {
					iron = 1
					copper = 1
				}
			}
			add_mercantilism = 1
		}
		add_years_of_owned_provinces_production_income = {
			years = 8
			trigger = {
				OR = {
					trade_goods = iron
					trade_goods = copper
				}
			}
			custom_tooltip = MONOPOLY_INCOME_IRON_AND_COPPER_DESC
		}
		custom_tooltip = estate_nobles_monopoly_of_metals_effect_tooltip
	}
	on_granted_province = {
		if = {
			limit = {
				OR = {
					trade_goods = iron
					trade_goods = copper
				}
			}
			add_province_modifier = {
				name = estate_nobles_monopoly_of_metals_mod
				duration = -1
			}
		}
		else_if = {
			limit = {
				has_province_modifier = estate_nobles_monopoly_of_metals_mod
			}
			remove_province_modifier = estate_nobles_monopoly_of_metals_mod
		}
	}
	on_revoked = {
		custom_tooltip = estate_nobles_monopoly_of_metals_revoke_tooltip
	}
	on_revoked_province = {
		if = {
			limit = {
				has_province_modifier = estate_nobles_monopoly_of_metals_mod
			}
			remove_province_modifier = estate_nobles_monopoly_of_metals_mod
		}
	}
	on_invalid = {
		custom_tooltip = estate_nobles_monopoly_of_metals_revoke_tooltip
	}
	on_invalid_province = {
		if = {
			limit = {
				has_province_modifier = estate_nobles_monopoly_of_metals_mod
			}
			remove_province_modifier = estate_nobles_monopoly_of_metals_mod
		}
	}
	penalties = {
	}
	benefits = {
	}

	cooldown_years = 10
	conditional_modifier = {
		trigger = {
			has_country_flag = buffed_monopolies
		}
		modifier = {
			max_absolutism = 10
			nobles_privilege_slots = 1
		}
	}
	on_cooldown_expires = {
		country_event = { id = monopoly_privileges.5 }
	}
	ai_will_do = {
		factor = 0
	}
}

estate_nobles_monopoly_of_livestock = {
	icon = privilege_monopoly_of_goods_livestock
	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 = livestock
		}
	}
	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 = {
				livestock = 1
			}
			add_mercantilism = 1
		}
		add_years_of_owned_provinces_production_income = {
			years = 8
			trigger = {
				trade_goods = livestock
			}
			custom_tooltip = MONOPOLY_INCOME_LIVESTOCK_DESC
		}
		custom_tooltip = estate_nobles_monopoly_of_livestock_effect_tooltip
	}
	on_granted_province = {
		if = {
			limit = {
				trade_goods = livestock
			}
			add_province_modifier = {
				name = estate_nobles_monopoly_of_livestock_mod
				duration = -1
			}
		}
		else_if = {
			limit = {
				has_province_modifier = estate_nobles_monopoly_of_livestock_mod
			}
			remove_province_modifier = estate_nobles_monopoly_of_livestock_mod
		}
	}
	on_revoked = {
		custom_tooltip = estate_nobles_monopoly_of_livestock_revoke_tooltip
	}
	on_revoked_province = {
		if = {
			limit = {
				has_province_modifier = estate_nobles_monopoly_of_livestock_mod
			}
			remove_province_modifier = estate_nobles_monopoly_of_livestock_mod
		}
	}
	on_invalid = {
		custom_tooltip = estate_nobles_monopoly_of_livestock_revoke_tooltip
	}
	on_invalid_province = {
		if = {
			limit = {
				has_province_modifier = estate_nobles_monopoly_of_livestock_mod
			}
			remove_province_modifier = estate_nobles_monopoly_of_livestock_mod
		}
	}
	penalties = {
	}
	benefits = {
	}
	cooldown_years = 10
	conditional_modifier = {
		trigger = {
			has_country_flag = buffed_monopolies
		}
		modifier = {
			max_absolutism = 10
			nobles_privilege_slots = 1
		}
	}
	on_cooldown_expires = {
		country_event = { id = monopoly_privileges.6 }
	}
	ai_will_do = {
		factor = 0
	}
}

estate_nobles_monopoly_of_gems = {
	icon = privilege_monopoly_of_goods_gems
	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 = gems
		}
	}
	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 = {
				gems = 1
			}
			add_mercantilism = 1
		}
		add_years_of_owned_provinces_production_income = {
			years = 8
			trigger = {
				trade_goods = gems
			}
			custom_tooltip = MONOPOLY_INCOME_GEMS_DESC
		}
		custom_tooltip = estate_nobles_monopoly_of_gems_effect_tooltip
	}
	on_granted_province = {
		if = {
			limit = {
				trade_goods = gems
			}
			add_province_modifier = {
				name = estate_nobles_monopoly_of_gems_mod
				duration = -1
			}
		}
		else_if = {
			limit = {
				has_province_modifier = estate_nobles_monopoly_of_gems_mod
			}
			remove_province_modifier = estate_nobles_monopoly_of_gems_mod
		}
	}
	on_revoked = {
		custom_tooltip = estate_nobles_monopoly_of_gems_revoke_tooltip
	}
	on_revoked_province = {
		if = {
			limit = {
				has_province_modifier = estate_nobles_monopoly_of_gems_mod
			}
			remove_province_modifier = estate_nobles_monopoly_of_gems_mod
		}
	}
	on_invalid = {
		custom_tooltip = estate_nobles_monopoly_of_gems_revoke_tooltip
	}
	on_invalid_province = {
		if = {
			limit = {
				has_province_modifier = estate_nobles_monopoly_of_gems_mod
			}
			remove_province_modifier = estate_nobles_monopoly_of_gems_mod
		}
	}
	penalties = {
	}
	benefits = {
	}

	cooldown_years = 10
	conditional_modifier = {
		trigger = {
			has_country_flag = buffed_monopolies
		}
		modifier = {
			max_absolutism = 10
			nobles_privilege_slots = 1
		}
	}
	on_cooldown_expires = {
		country_event = { id = monopoly_privileges.7 }
	}
	ai_will_do = {
		factor = 0
	}
}

estate_nobles_junker_primacy = {
	icon = privilege_royal_authority
	max_absolutism = -5
	conditional_modifier = { trigger = { has_absolutism_reduction_for_estate_privileges = yes } modifier = { max_absolutism = 1 } }
	loyalty = 0.05
	is_valid = {
		has_dlc = "Emperor"
		OR = {
			has_reform = prussian_monarchy
			has_reform = prussian_monarchy_base
			has_reform = prussian_republic_reform
		}
	}
	penalties = {
		#all_power_cost = 0.05
	}
	conditional_modifier = {
		trigger = {
			has_country_flag = GER_upgrade_the_junker_primacy_flag 
		}
		modifier = {
			monthly_militarized_society = 0.06
			monthly_prussian_militarized_society_1 = 0.04
			monthly_prussian_militarized_society_2 = 0.1
			monthly_prussian_militarized_society_3 = 0.15
		}
	}
	conditional_modifier = {
		trigger = {
			NOT = { has_country_flag = GER_upgrade_the_junker_primacy_flag }
		}
		modifier = {
			monthly_militarized_society = 0.03
			monthly_prussian_militarized_society_1 = 0.02
			monthly_prussian_militarized_society_2 = 0.05
			monthly_prussian_militarized_society_3 = 0.075
		}
	}
	ai_will_do = {
		factor = 1000
		modifier = {
			factor = 10
			has_dlc = "Rights of Man"
		}
		modifier = {
			factor = 0.5
			is_absolutism_active = yes
		}
	}
}

estate_nobles_strong_duchies = {
	icon = privilege_royal_authority
	max_absolutism = -10
	conditional_modifier = { trigger = { has_absolutism_reduction_for_estate_privileges = yes } modifier = { max_absolutism = 2 } }
	influence = 0.1
	loyalty = 0.05
	check_valid_when_tag_switching = no
	is_valid = {
		any_subject_country = {
			OR = {
				is_subject_of_type = vassal
				is_subject_of_type = client_vassal
				is_subject_of_type = march
				is_subject_of_type = client_march
				is_subject_of_type = personal_union
				is_subject_of_type = incorporated_vassal
				is_subject_of_type = integrated_personal_union
			}
		}
		NOT = { has_estate_privilege = estate_nobles_french_strong_duchies }
	}
	can_select = {
		custom_trigger_tooltip = {
			tooltip = estate_nobles_strong_duchies_trigger_tooltip
			calc_true_if = {
				amount = 2
				all_subject_country = {
					OR = {
						is_subject_of_type = vassal
						is_subject_of_type = client_vassal
						is_subject_of_type = march
						is_subject_of_type = client_march
						is_subject_of_type = personal_union
						is_subject_of_type = incorporated_vassal
						is_subject_of_type = integrated_personal_union
					}
				}
			}
		}
	}
	penalties = {
	}
	benefits = {
		diplomatic_upkeep = 2
		reduced_liberty_desire = 10
	}
	conditional_modifier = {
		trigger = { has_government_attribute = buffed_strong_duchies }
		modifier = {
			nobles_loyalty_modifier = 0.05
		}
	}
	conditional_modifier = {
		trigger = { has_government_mechanic = russian_modernization_mechanic }
		modifier = { monthly_russian_modernization = -0.05 }
	}
	conditional_modifier = {
		trigger = { has_country_flag = hun_upgrade_strong_duchies }
		modifier = { 	vassal_forcelimit_bonus = 0.5 }
	}
	conditional_modifier = {
		trigger = { has_country_flag = hab_upgraded_strong_duchies }
		modifier = { 
			vassal_forcelimit_bonus = 0.25
			vassal_income = 0.1
		}
	}
	ai_will_do = {
		factor = 100
		modifier = {
			factor = 3
			calc_true_if = {
				amount = 1
				all_subject_country = {
					OR = {
						is_march = yes
						is_vassal = yes
					}
				}
			}
		}
		modifier = {
			factor = 2
			calc_true_if = {
				amount = 2
				all_subject_country = {
					OR = {
						is_march = yes
						is_vassal = yes
					}
				}
			}
		}
	}
}

estate_nobles_golden_liberty = {
	icon = privilege_golden_liberty
	max_absolutism = -15
	conditional_modifier = { trigger = { has_absolutism_reduction_for_estate_privileges = yes } modifier = { max_absolutism = 3 } }
	influence = 0.1
	loyalty = 0.05
	is_valid = {
		OR = {
			has_estate_privilege = estate_nobles_golden_liberty #Poland starts with it
			has_reform = elective_monarchy
			has_reform = polish_elective_monarchy 
		}
	}
	can_revoke = {
		if = {
			limit = {
				OR = {
					tag = PLC
					AND = {
						tag = POL
						NOT = { exists = PLC }
					}
				}
			}
			OR = {
				AND = { 
					NOT = { has_reform = polish_elective_monarchy } 
					NOT = { has_reform = elective_monarchy }
				}
				has_reform = polish_autocratic_monarchy
				mission_completed = plc_golden_liberty
				absolutism = 70
				AND = {
					is_year = 1615
					crown_land_share = 90
				}
			}
		}
		stability = 3
		has_regency = no
	}
	on_revoked = {
		if = {
			limit = { has_estate = estate_nobles }
			add_stability = -3
		}
		if = {
			limit = {
				OR = {
					tag = PLC
					AND = {
						tag = POL
						NOT = { exists = PLC }
					}
				}
			}
			if = {
				limit = {
					has_estate_privilege = estate_nobles_nieszawa_privileges
				}
				remove_estate_privilege = estate_nobles_nieszawa_privileges
			}
			if = {
				limit = {
					has_estate_privilege = estate_nobles_pacta_conventa
				}
				remove_estate_privilege = estate_nobles_pacta_conventa
			}
			if = {
				limit = {
					NOT = { has_country_flag = pol_zebrzydowski_rebellion_flag }
					is_year = 1600
					government = monarchy
				}
				set_country_flag = pol_pact_conventa_flag
			}
		}
		else_if = {
			limit = {
				OR = { 
					has_reform = elective_monarchy
					has_reform = polish_elective_monarchy
				}
				has_estate = estate_nobles
			}
			country_event = { id = estate_privileges_and_agendas_events.1 }
		}
	}
	penalties = {
	}
	benefits = {
		global_manpower_modifier = 0.33
	}
	mechanics = {
		exempt_from_seize_land
	}
	ai_will_do = {
		factor = 10
	}
}

estate_nobles_nieszawa_privileges = {
	icon = privilege_royal_authority
	max_absolutism = -5
	conditional_modifier = { trigger = { has_absolutism_reduction_for_estate_privileges = yes } modifier = { max_absolutism = 1 } }
	influence = 0.05
	loyalty = 0.05
	is_valid = {
		has_estate_privilege = estate_nobles_nieszawa_privileges #event privilege for Poland
	}
	can_revoke = no
	penalties = {
		technology_cost = 0.05
	}
	benefits = {
		stability_cost_modifier = -0.2
	}
	ai_will_do = {
		factor = 0
	}
}

estate_nobles_pacta_conventa = {
	icon = privilege_royal_authority
	max_absolutism = -5
	conditional_modifier = { trigger = { has_absolutism_reduction_for_estate_privileges = yes } modifier = { max_absolutism = 1 } }
	influence = 0.05
	loyalty = 0.05
	is_valid = {
		has_estate_privilege = estate_nobles_pacta_conventa #event privilege for Poland
	}
	can_revoke = no
	penalties = {
		war_exhaustion_cost = 0.5
		inflation_action_cost = 0.5
	}
	benefits = {
	}
	ai_will_do = {
		factor = 0
	}
}

estate_nobles_veto_heir_apparent = {
	icon = privilege_royal_authority
	max_absolutism = -5
	conditional_modifier = { trigger = { has_absolutism_reduction_for_estate_privileges = yes } modifier = { max_absolutism = 1 } }
	loyalty = -0.05
	is_valid = {
		has_dlc = "Emperor"
		OR = { 
			has_reform = polish_elective_monarchy
			has_reform = elective_monarchy
		}
	}
	penalties = {
	}
	benefits = {
		monthly_support_heir_gain = 0.33
	}
	ai_will_do = {
		factor = 0
	}
}

estate_nobles_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_nobles_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.05 }
	}
	#conditional_modifier = {
	#	trigger = { has_government_mechanic = ottoman_decadence_mechanic }
	#	modifier = { monthly_ottoman_decadence = 0.02 }
	#}
	ai_will_do = {
		factor = 0
	}

	cooldown_years = 20
}

estate_nobles_command_of_the_military = {
	icon = privilege_promote_purbias
	land_share = 10
	max_absolutism = -10
	conditional_modifier = { trigger = { has_absolutism_reduction_for_estate_privileges = yes } modifier = { max_absolutism = 2 } }
	influence = 0.20

	is_valid = {
		has_estate_privilege = estate_nobles_command_of_the_military
	}
	can_select = {
	}
	on_granted = {
		custom_tooltip = estate_nobles_command_of_the_military_tt
	}
	on_revoked = {
		custom_tooltip = estate_nobles_command_of_the_military_tt
	}
	penalties = {
		leader_cost = 0.2
	}
	benefits = {
		army_tradition = 1
	}
	ai_will_do = {
		factor = 1000
	}
}

estate_nobles_better_integration = {
	icon = privilege_better_integration
	max_absolutism = -10
	conditional_modifier = { trigger = { has_absolutism_reduction_for_estate_privileges = yes } modifier = { max_absolutism = 2 } }
	influence = 0.05
	loyalty = 0
	check_valid_when_tag_switching = no
	is_valid = {
		any_subject_country = {
			OR = {
				is_subject_of_type = vassal
				is_subject_of_type = client_vassal
				is_subject_of_type = daimyo_vassal
				is_subject_of_type = personal_union
				is_subject_of_type = appanage
				is_subject_of_type = incorporated_vassal
				is_subject_of_type = integrated_personal_union
			}
		}
	}
	can_select = {
	}
	on_granted = {
		disable_annexation_penalty = yes
	}
	on_revoked = {
		enable_annexation_penalty = yes
	}
	on_invalid = {
		enable_annexation_penalty = yes
	}
	penalties = {
		reduced_liberty_desire = -15
	}
	benefits = {
		diplomatic_annexation_cost = -0.05
	}
	cooldown_years = 10
	conditional_modifier = {
		trigger = { has_government_mechanic = russian_modernization_mechanic }
		modifier = { monthly_russian_modernization = -0.05 }
	}
	#conditional_modifier = {
	#	trigger = { has_government_mechanic = ottoman_decadence_mechanic }
	#	modifier = { monthly_ottoman_decadence = 0.02 }
	#}
	ai_will_do = {
		factor = 10
	}
}

estate_nobles_neighbor_raids = {
	icon = privilege_demand_more_troops
	max_absolutism = -10
	conditional_modifier = { trigger = { has_absolutism_reduction_for_estate_privileges = yes } modifier = { max_absolutism = 2 } }
	influence = 0.05
	loyalty = 0
	is_valid = {
		NOT = { has_country_modifier = the_abolish_slavery_act }
		has_dlc = "Origins"
		OR = {
			technology_group = east_african
			technology_group = central_african
			technology_group = sub_saharan
			has_reform = steppe_horde
			has_reform = great_mongol_state_reform
		}
	}
	can_select = {
		NOT = { has_country_modifier = the_abolish_slavery_act }
	}
	on_granted = {
		enable_capital_slave_raid = yes
	}
	on_revoked = {
		disable_capital_slave_raid = yes
	}
	on_invalid = {
		disable_capital_slave_raid = yes
	}
	penalties = {
	}
	benefits = {
	}
	ai_will_do = {
		factor = 0
	}
}

#Mission tree rewards

estate_nobles_cawa_peace_keepers = {
	icon = privilege_cawa_peacekeeper
	max_absolutism = 0
	influence = 0
	loyalty = 0.05
	is_valid = {
		has_unlocked_estate_privilege = { estate_privilege = estate_nobles_cawa_peace_keepers }
	}
	can_select = {
		custom_trigger_tooltip = {
			tooltip = eth_estate_did_not_have_cawa_privilege_for_five_years
			OR = {
				NOT = { has_country_flag = picked_cawa_privilege }
				had_country_flag = {
					flag = picked_cawa_privilege
					days = 1825
				}
			}
		}
	}
	on_granted = {
		remove_estate_privilege = estate_nobles_cawa_offensive_fighters
		hidden_effect = {
			clr_country_flag = picked_cawa_privilege
			set_country_flag = picked_cawa_privilege
		}
		add_country_modifier = {
			name = estate_nobles_cawa_peace_keepers_modifier
			duration = -1
		}
	}
	on_revoked = {
		remove_country_modifier = estate_nobles_cawa_peace_keepers_modifier
	}
	on_invalid = {
		remove_country_modifier = estate_nobles_cawa_peace_keepers_modifier
	}
	penalties = {
	}
	benefits = {
		nobles_privilege_slots = 1
	}
	cooldown_years = 5
	ai_will_do = {
		factor = 4
		modifier = {
			factor = 0
			NOT = { num_of_cawa = 10 }
		}
		modifier = {
			factor = 2
			is_at_war = no
		}
		modifier = {
			factor = 2
			is_in_important_war = no
		}
		modifier = {
			factor = 4
			num_of_rebel_armies = 3
		}
		modifier = {
			factor = 4
			num_of_rebel_controlled_provinces = 3
		}
		modifier = {
			factor = 4
			NOT = { stability = 0 }
		}
		modifier = {
			factor = 0.5
			is_absolutism_active = yes
		}
	}
}

estate_nobles_cawa_offensive_fighters = {
	icon = privilege_cawa_offensive_fighters
	max_absolutism = 0
	influence = 0
	loyalty = 0.05
	is_valid = {
		has_unlocked_estate_privilege = { estate_privilege = estate_nobles_cawa_offensive_fighters }
	}
	can_select = {
		custom_trigger_tooltip = {
			tooltip = eth_estate_did_not_have_cawa_privilege_for_five_years
			OR = {
				NOT = { has_country_flag = picked_cawa_privilege }
				had_country_flag = {
					flag = picked_cawa_privilege
					days = 1825
				}
			}
		}
	}
	on_granted = {
		remove_estate_privilege = estate_nobles_cawa_peace_keepers
		hidden_effect = {
			clr_country_flag = picked_cawa_privilege
			set_country_flag = picked_cawa_privilege
		}
		add_country_modifier = {
			name = estate_nobles_cawa_offensive_fighters_modifier
			duration = -1
		}
	}
	on_revoked = {
		remove_country_modifier = estate_nobles_cawa_offensive_fighters_modifier
	}
	on_invalid = {
		remove_country_modifier = estate_nobles_cawa_offensive_fighters_modifier
	}
	penalties = {
	}
	benefits = {
		nobles_privilege_slots = 1
	}
	cooldown_years = 5
	ai_will_do = {
		factor = 4
		modifier = {
			factor = 0
			NOT = { num_of_cawa = 10 }
		}
		modifier = {
			factor = 5
			is_at_war = yes
		}
		modifier = {
			factor = 10
			is_in_important_war = yes
		}
		modifier = {
			factor = 0.5
			is_absolutism_active = yes
		}
	}
}

estate_nobles_grant_power_to_the_bashorun = {
	icon = privilege_royal_authority
	max_absolutism = -15
	conditional_modifier = { trigger = { has_absolutism_reduction_for_estate_privileges = yes } modifier = { max_absolutism = 3 } }
	influence = 0.05
	loyalty = 0.1
	is_valid = {
		has_unlocked_estate_privilege = { estate_privilege = estate_nobles_grant_power_to_the_bashorun }
	}
	can_select = {
		custom_trigger_tooltip = {
			tooltip = can_not_have_tributaries
			NOT = { has_reform = celestial_empire }
			NOT = { has_government_attribute = has_tributaries }
			NOT = { has_country_flag = can_create_tributaries_flag }
			NOT = { is_nomad = yes }
			NOT = { religion_group = eastern }
			NOT = { technology_group = chinese }
			NOT = { technology_group = polynesian_tech }
		}
	}
	on_granted = {
		enable_tributary_state_use_estate = yes
	}
	on_invalid = {
		disable_tributary_state_use_estate = yes
	}
	on_revoked = {
		disable_tributary_state_use_estate = yes
	}
	penalties = {
	}
	benefits = {
		stability_cost_modifier = -0.1
	}
	ai_will_do = {
		factor = 25
		modifier = {
			factor = 0
			is_absolutism_active = yes
		}
	}
}

estate_nobles_carolean_march = {
	icon = privilege_carolean_march
	max_absolutism = 0
	influence = 0
	loyalty = 0.05
	is_valid = {
		has_unlocked_estate_privilege = { estate_privilege = estate_nobles_carolean_march }
	}
	can_select = {
		custom_trigger_tooltip = {
			tooltip = estate_did_not_have_carolean_privilege_for_five_years
			OR = {
				NOT = { has_country_flag = picked_carolean_privilege }
				had_country_flag = {
					flag = picked_carolean_privilege
					days = 1825
				}
			}
		}
		if = {
			limit = { has_dlc = "Cradle of Civilization" }
			army_professionalism = 0.4
		}
		army_tradition = 30
	}
	on_granted = {
		if = {
			limit = { has_estate_privilege = estate_nobles_carolean_charge }
			remove_estate_privilege = estate_nobles_carolean_charge
		}
		hidden_effect = {
			clr_country_flag = picked_carolean_privilege
			set_country_flag = picked_carolean_privilege
		}
		add_country_modifier = {
			name = estate_nobles_carolean_march_modifier
			duration = -1
		}
	}
	on_revoked = {
		remove_country_modifier = estate_nobles_carolean_march_modifier
	}
	on_invalid = {
		remove_country_modifier = estate_nobles_carolean_march_modifier
	}
	penalties = {
		amount_of_carolean = -0.1
	}
	benefits = {
		nobles_privilege_slots = 1
	}
	cooldown_years = 5
	ai_will_do = {
		factor = 4
		modifier = {
			factor = 0
			NOT = { num_of_carolean = 10 }
		}
	}
}

estate_nobles_carolean_charge = {
	icon = privilege_carolean_charge
	max_absolutism = 0
	influence = 0
	loyalty = 0.05
	is_valid = {
		has_unlocked_estate_privilege = { estate_privilege = estate_nobles_carolean_charge }
	}
	can_select = {
		custom_trigger_tooltip = {
			tooltip = estate_did_not_have_carolean_privilege_for_five_years
			OR = {
				NOT = { has_country_flag = picked_carolean_privilege }
				had_country_flag = {
					flag = picked_carolean_privilege
					days = 1825
				}
			}
		}
		if = {
			limit = { has_dlc = "Cradle of Civilization" }
			army_professionalism = 0.4
		}
		army_tradition = 30
	}
	on_granted = {
		if = {
			limit = { has_estate_privilege = estate_nobles_carolean_march }
			remove_estate_privilege = estate_nobles_carolean_march
		}
		hidden_effect = {
			clr_country_flag = picked_carolean_privilege
			set_country_flag = picked_carolean_privilege
		}
		add_country_modifier = {
			name = estate_nobles_carolean_charge_modifier
			duration = -1
		}
	}
	on_revoked = {
		remove_country_modifier = estate_nobles_carolean_charge_modifier
	}
	on_invalid = {
		remove_country_modifier = estate_nobles_carolean_charge_modifier
	}
	penalties = {
		amount_of_carolean = -0.1
	}
	benefits = {
		nobles_privilege_slots = 1
	}
	cooldown_years = 5
	ai_will_do = {
		factor = 4
		modifier = {
			factor = 0
			NOT = { num_of_carolean = 10 }
		}
	}
}

estate_nobles_leidang_conscription = {
	icon = privilege_sailors
	max_absolutism = -5
	conditional_modifier = { trigger = { has_absolutism_reduction_for_estate_privileges = yes } modifier = { max_absolutism = 1 } }
	influence = 0.05
	loyalty = 0.05
	is_valid = {
		has_unlocked_estate_privilege = { estate_privilege = estate_nobles_leidang_conscription }
	}
	can_select = {
		num_of_ports = 1
	}
	penalties = {
		manpower_recovery_speed = -0.1
	}
	benefits = {
		sailors_recovery_speed = 0.25
		allowed_marine_fraction = 0.5
		burghers_loyalty_modifier = 0.05
		burghers_influence_modifier = 0.05
		nobles_privilege_slots = 1
	}
	ai_will_do = {
		factor = 1
		modifier = {
			factor = 0
			is_absolutism_active = yes
		}
	}
}

estate_nobles_leidang_mass_conscription = {
	icon = privilege_marines
	max_absolutism = 0
	influence = 0
	loyalty = 0.05
	cooldown_years = 5
	is_valid = {
		has_unlocked_estate_privilege = { estate_privilege = estate_nobles_leidang_mass_conscription }
		OR = {
			has_dlc = "Rule Britannia"
			has_dlc = "Golden Century"
			has_dlc = "Lions of the North"
		}
	}
	can_select = {
		has_estate_privilege = estate_nobles_leidang_conscription
	}
	penalties = {
		
	}
	benefits = {
		nobles_privilege_slots = 1
		allowed_marine_fraction = 0.25
		global_sailors_modifier = 0.2
	}
	on_granted = {
		add_country_modifier = {
			name = estate_nobles_leidang_mass_conscription_mod
			duration = -1
		}
		if = {
			limit = {
				has_estate_privilege = estate_nobles_leidang_elite_conscription
			}
			remove_estate_privilege = estate_nobles_leidang_elite_conscription
		}
		else = {
			custom_tooltip = has_no_effects_on_granted
		}
	}
	on_invalid = {
		remove_country_modifier = estate_nobles_leidang_mass_conscription_mod
	}
	on_revoked = {
		remove_country_modifier = estate_nobles_leidang_mass_conscription_mod
	}
	ai_will_do = {
		factor = 0
	}
}

estate_nobles_leidang_elite_conscription = {
	icon = privilege_marines
	max_absolutism = 0
	influence = 0
	loyalty = 0.05
	cooldown_years = 5
	is_valid = {
		has_unlocked_estate_privilege = { estate_privilege = estate_nobles_leidang_elite_conscription }
		OR = {
			has_dlc = "Rule Britannia"
			has_dlc = "Golden Century"
			has_dlc = "Lions of the North"
		}
	}
	can_select = {
		has_estate_privilege = estate_nobles_leidang_conscription
	}
	penalties = {
		allowed_marine_fraction = -0.25
		global_sailors_modifier = -0.2
	}
	benefits = {
		nobles_privilege_slots = 1
	}
	on_granted = {
		add_country_modifier = {
			name = estate_nobles_leidang_elite_conscription_mod
			duration = -1
		}
		if = {
			limit = {
				has_estate_privilege = estate_nobles_leidang_mass_conscription
			}
			remove_estate_privilege = estate_nobles_leidang_mass_conscription
		}
	}
	on_invalid = {
		remove_country_modifier = estate_nobles_leidang_elite_conscription_mod
	}
	on_revoked = {
		remove_country_modifier = estate_nobles_leidang_elite_conscription_mod
	}
	ai_will_do = {
		factor = 0
	}
}

estate_nobles_religious_conscription = {
	icon = privilege_manpower_of_true_faith
	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_unlocked_estate_privilege = { estate_privilege = estate_nobles_religious_conscription }
		has_estate = estate_church
	}
	can_select = {
		has_estate = estate_church
	}
	can_revoke = {
		estate_loyalty = {
			estate = estate_church
			higher_than_influence = yes
		}
	}
	on_granted = {
		custom_tooltip = estate_nobles_religious_conscription_effect_tooltip
		hidden_effect = {
			set_country_flag = gets_manpower_from_tax_buildings
		}
	}
	on_granted_province = {
		if = {
			limit = {
				religion = ROOT
			}
			if = {
				limit = { has_building = cathedral }
				add_province_modifier = {
					name = estate_nobles_religious_conscription_cathedral
					duration = -1
				}
			}
			else_if = {
				limit = { has_building = temple }
				add_province_modifier = {
					name = estate_nobles_religious_conscription_temple
					duration = -1
				}
			}
		}
		else_if = {
			limit = {
				OR = {
					has_province_modifier = estate_nobles_religious_conscription_cathedral
					has_province_modifier = estate_nobles_religious_conscription_temple
				}
			}
			remove_province_modifier = estate_nobles_religious_conscription_cathedral
			remove_province_modifier = estate_nobles_religious_conscription_temple
		}
	}
	on_revoked = {
		custom_tooltip = estate_nobles_religious_conscription_revoke_effect_tooltip
		hidden_effect = {
			clr_country_flag = gets_manpower_from_tax_buildings
		}
		add_estate_loyalty = {
			estate = estate_church
			loyalty = -20
		}
	}
	on_revoked_province = {
		if = {
			limit = {
				OR = {
					has_province_modifier = estate_nobles_religious_conscription_cathedral
					has_province_modifier = estate_nobles_religious_conscription_temple
				}
			}
			remove_province_modifier = estate_nobles_religious_conscription_cathedral
			remove_province_modifier = estate_nobles_religious_conscription_temple
		}
	}
	on_invalid = {
		custom_tooltip = estate_nobles_religious_conscription_revoke_effect_tooltip
		hidden_effect = {
			clr_country_flag = gets_manpower_from_tax_buildings
		}
	}
	on_invalid_province = {
		if = {
			limit = {
				OR = {
					has_province_modifier = estate_nobles_religious_conscription_cathedral
					has_province_modifier = estate_nobles_religious_conscription_temple
				}
			}
			remove_province_modifier = estate_nobles_religious_conscription_cathedral
			remove_province_modifier = estate_nobles_religious_conscription_temple
		}
	}
	penalties = {
	}
	benefits = {
		church_loyalty_modifier = 0.05
		church_influence_modifier = 0.15
	}
	ai_will_do = {
		factor = 10
	}
}

#Government reform specific
estate_nobles_decentralized_tribe = {
	icon = privilege_decentralized
	max_absolutism = -20
	conditional_modifier = { trigger = { has_absolutism_reduction_for_estate_privileges = yes } modifier = { max_absolutism = 4 } }
	influence = 0.1
	land_share = 5
	loyalty = 0.05
	is_valid = {
		has_government_attribute = has_internal_tribes
		NOT = { has_country_flag = centralized_tribes_level_2 }
	}
	can_select = {
		NOT = { has_estate_privilege = estate_nobles_tribe_unification }
		NOT = { has_estate_privilege = estate_nobles_tribe_centralization }
	}
	can_revoke = {
		custom_trigger_tooltip = {
			tooltip = estate_nobles_decentralized_tribe_tt
			has_country_flag = centralized_tribes_level_2
		}
	}
	modifier_by_land_ownership = {
		nobles_loyalty_modifier = 0.2
		land_forcelimit_modifier = 0.2
		manpower_recovery_speed = 0.15
		global_autonomy = 0.05
	}
	mechanics = {
		exempt_from_seize_land
	}
	on_granted = {
		add_estate_loyalty = {
			estate = estate_nobles
			loyalty = 5
		}
		hidden_effect = {
			set_country_flag = centralized_tribes_level_1
		}
	}
	ai_will_do = {
		factor = 1000
	}
}

estate_nobles_tribe_unification = {
	icon = privilege_unifying
	max_absolutism = -10
	conditional_modifier = { trigger = { has_absolutism_reduction_for_estate_privileges = yes } modifier = { max_absolutism = 2 } }
	influence = 0.05
	loyalty = 0
	is_valid = {
		has_government_attribute = has_internal_tribes
		has_country_flag = centralized_tribes_level_1
	}
	can_select = {
		legitimacy = 90
		NOT = { num_of_rebel_controlled_provinces = 1 }
		NOT = { num_of_rebel_armies = 1 }
		estate_loyalty = {
			estate = estate_nobles
			loyalty = 70
		}
		stability = 2
	}
	modifier_by_land_ownership = {
		nobles_loyalty_modifier = 0.1
		land_forcelimit_modifier = 0.1
		manpower_recovery_speed = 0.075
		global_autonomy = 0.025
	}
	benefits = {
		legitimacy = 0.25
	}
	on_granted = {
		tooltip = {
			add_estate_loyalty = {
				estate = estate_nobles
				loyalty = -40
			}
			add_stability = -1
			remove_estate_privilege = estate_nobles_decentralized_tribe
		}
		hidden_effect = {
			set_country_flag = centralized_tribes_level_2
			country_event = {
				id = flavor_jol.100
			}
		}
	}
	can_revoke = {
		custom_trigger_tooltip = {
			tooltip = estate_nobles_tribe_unification_tt
			has_estate_privilege = estate_nobles_tribe_centralization
		}
	}
	mechanics = {
		exempt_from_seize_land
	}
	ai_will_do = {
		factor = 1000
	}
}

estate_nobles_tribe_centralization = {
	icon = privilege_centralized
	max_absolutism = 0
	influence = 0
	loyalty = 0
	is_valid = {
		has_government_attribute = has_internal_tribes
		has_country_flag = centralized_tribes_level_2
	}
	can_select = {
		legitimacy = 90
		NOT = { num_of_rebel_controlled_provinces = 1 }
		NOT = { num_of_rebel_armies = 1 }
		estate_loyalty = {
			estate = estate_nobles
			loyalty = 80
		}
		stability = 2
	}
	on_granted = {
		tooltip = {
			add_stability = -2
			add_estate_loyalty = {
				estate = estate_nobles
				loyalty = -50
			}
			change_government = monarchy
			change_government_reform_progress = 100
			remove_estate_privilege = estate_nobles_tribe_unification
			remove_estate_privilege = estate_nobles_tribe_centralization
		}
		hidden_effect = {
			clr_country_flag = centralized_tribes_level_1
			clr_country_flag = centralized_tribes_level_2
			set_country_flag = centralized_tribes_level_3
			country_event = {
				id = flavor_jol.101
			}
		}
	}
	ai_will_do = {
		factor = 1000
	}
}

#Norwegian starting privileges
estate_nobles_danish_nobility = {
	icon = privilege_autonomy
	max_absolutism = -25
	conditional_modifier = { trigger = { has_absolutism_reduction_for_estate_privileges = yes } modifier = { max_absolutism = 5 } }
	influence = 0.1
	land_share = 5
	loyalty = 0.05
	is_valid = {
		has_dlc = "Lions of the North"
		has_estate_privilege = estate_nobles_danish_nobility
	}
	can_revoke = {
		stability = 1
		NOT = { num_of_rebel_controlled_provinces = 1 }
		NOT = { num_of_rebel_armies = 1 }
	}
	on_revoked = {
		add_stability = -1
		random_owned_province = {
			spawn_rebels = {
				type = noble_rebels
				size = 2
			}
		}
	}
	penalties = {
		yearly_corruption = 0.03
	}
	modifier_by_land_ownership = {
		global_tax_modifier = -0.25
	}
	mechanics = {
		exempt_from_seize_land
	}
	on_granted = {
	}
	ai_will_do = {
		factor = -300
	}
}

estate_nobles_nobles_instead_of_royal_court = {
	icon = privilege_legitimacy
	max_absolutism = -25
	conditional_modifier = { trigger = { has_absolutism_reduction_for_estate_privileges = yes } modifier = { max_absolutism = 5 } }
	influence = 0.1
	land_share = 5
	loyalty = 0
	is_valid = {
		has_dlc = "Lions of the North"
		has_estate_privilege = estate_nobles_nobles_instead_of_royal_court
	}
	can_revoke = {
		stability = 1
		NOT = { num_of_rebel_controlled_provinces = 1 }
		NOT = { num_of_rebel_armies = 1 }
	}
	on_revoked = {
		add_stability = -1
		random_owned_province = {
			spawn_rebels = {
				type = noble_rebels
				size = 2
			}
		}
	}
	penalties = {
		legitimacy = -0.5
		monthly_heir_claim_increase = -0.33
		stability_cost_modifier = -0.1
	}
	mechanics = {
		exempt_from_seize_land
	}
	ai_will_do = {
		factor = -300
	}
}

#Poland Privileges 

estate_nobles_sponsor_hussars = {
	icon = privilege_make_generous_donation
	max_absolutism = -15
	conditional_modifier = { trigger = { has_absolutism_reduction_for_estate_privileges = yes } modifier = { max_absolutism = 3 } }
	is_valid = {
		has_estate_privilege = estate_nobles_sponsor_hussars
	}
	influence = 0.05
	loyalty = -0.05
	benefits = { 
		amount_of_hussars = 6
	}
	penalties = {
	}
	cooldown_years = 50
	ai_will_do = {
		factor = 1
	}
}

#Mansabdari Privileges
estate_nobles_mansabdari_cav_maintenance = {
	icon = privilege_raise_host
	is_valid = { has_government_attribute = enable_mansabdar_privileges }
	loyalty = 0
	influence = 0.05
	max_absolutism = -5
	conditional_modifier = { trigger = { has_absolutism_reduction_for_estate_privileges = yes } modifier = { max_absolutism = 1 } }
	benefits = {
		cav_to_inf_ratio = 0.25
	}
	loyalty_scaled_conditional_modifier = {
		trigger = {
			always = yes
		}
		modifier = {
			cavalry_cost = -0.5
		}
	}
	ai_will_do = {
		factor = 1
	}
}

estate_nobles_mansabdari_military_service = {
	icon = privilege_yearly_army_tradition
	is_valid = { has_government_attribute = enable_mansabdar_privileges }
	loyalty = 0
	influence = 0.05
	max_absolutism = -5
	conditional_modifier = { trigger = { has_absolutism_reduction_for_estate_privileges = yes } modifier = { max_absolutism = 1 } }
	benefits = {
		leader_land_manuever = 1
	}
	influence_scaled_conditional_modifier = {
		trigger = {
			always = yes
		}
		modifier = {
			army_tradition_decay = -0.01
		}
	}
	ai_will_do = {
		factor = 25
	}
}

estate_nobles_mansabdari_royal_rule = {
	icon = privilege_royal_rule
	is_valid = { has_government_attribute = enable_mansabdar_privileges }
	loyalty = -0.15
	influence = -0.3
	max_absolutism = 10
	penalties = {
		land_maintenance_modifier = 0.1
	}
	mechanics = {  }
	ai_will_do = {
		factor = 1
	}
}

#Boyars Privileges

estate_nobles_rynda = {
	icon = privilege_infantry
	is_valid = { has_government_attribute = unlock_boyars_military_privileges }
	loyalty = 0.05
	influence = 0.05
	max_absolutism = -5
	conditional_modifier = { trigger = { has_absolutism_reduction_for_estate_privileges = yes } modifier = { max_absolutism = 1 } }
	on_granted = {
		custom_tooltip = estate_nobles_rynda_at
		custom_tooltip = SCALES_WITH_LOYALTY_TT
	}
	loyalty_scaled_conditional_modifier = {
		trigger = { is_monarch_leader = yes }
		modifier = { infantry_power = 0.15 }
	}
	loyalty_scaled_conditional_modifier = {
		trigger = { is_monarch_leader = no }
		modifier = { infantry_cost = -0.2 }
	}
	mechanics = {  }
	ai_will_do = {
		factor = 1
	}
}

estate_nobles_landed_army = {
	icon = privilege_raise_host
	is_valid = { has_government_attribute = unlock_boyars_military_privileges }
	loyalty = 0.05
	influence = 0.05
	max_absolutism = -5
	conditional_modifier = { trigger = { has_absolutism_reduction_for_estate_privileges = yes } modifier = { max_absolutism = 1 } }
	benefits = {
		cav_to_inf_ratio = 0.25
		cavalry_cost = -0.1
	}
	on_granted = {
		custom_tooltip = estate_nobles_landed_army_tt
		custom_tooltip = SCALES_WITH_INFLUENCE_TT
	}
	influence_scaled_conditional_modifier = {
		trigger = { always = yes }
		modifier = { cavalry_power = 0.2 }
	}
	mechanics = {  }
	ai_will_do = {
		factor = 1
	}
}

#Russia Privileges
estate_nobles_mestnichestvo = {
	icon = privilege_investigate_corruption
	is_valid = {
		has_estate_privilege = estate_nobles_mestnichestvo
		OR = {
			ai = no
			NOT = { is_year = 1500 }
		}
	}
	loyalty = 0.05
	influence = 0.1
	max_absolutism = -10
	conditional_modifier = { trigger = { has_absolutism_reduction_for_estate_privileges = yes } modifier = { max_absolutism = 2 } }
	penalties = {
		reform_progress_growth = -0.33
	}
	can_revoke = {
		if = {
			limit = { OR = { ai = no was_player = yes } }
			stability = 1
			legitimacy = 90
		}
		else = {
			is_year = 1500
		}
	}
	on_revoked = {
		if = {
			limit = { OR = { ai = no was_player = yes } }
			add_stability = -1
			add_legitimacy = -15
			add_corruption = 2
		}
	}
	conditional_modifier = {
		trigger = {
			has_government_mechanic = russian_modernization_mechanic
		}
		modifier = {
			monthly_russian_modernization = -1
			russian_modernization_gain_modifier = -1
		}
		is_bad = yes
	}
	#modifier_by_land_ownership = {
	#	yearly_corruption = 0.4
	#}
	ai_will_do = {
		factor = -300
	}
}

estate_nobles_early_serfdom = {
	icon = privilege_serf
	loyalty = 0.15
	influence = 0.05
	max_absolutism = 0
	is_valid = {
		has_dlc = "Domination"
		OR = {
			has_reform = principality
			has_reform = veche_republic
			has_reform = tsardom
			has_reform = russian_empire_reform
			has_reform = great_veche_republic
			has_reform = great_russian_republic_reform
		}
		NOT = { has_country_flag = liberated_peasants }
		NOT = { has_country_flag = level_two_serfdom_privileges }
		NOT = { has_country_flag = level_three_serfdom_privileges }
		NOT = { has_country_flag = final_serfdom_privileges }
	}
	can_select = {
		NOT = { has_estate_privilege = estate_nobles_increased_peasant_freedom }
	}
	can_revoke = no
	on_granted = {
		custom_tooltip = estate_privilege_cannot_be_revoked
		block_estate_removing_reforms = {
			estate = estate_nobles
		}
		country_event = {
			id = flavor_rus.300
		}
		set_country_flag = rus_enacted_early_serfdom_flag
		set_country_flag = rus_peasant_fate
		clr_country_flag = rus_enacted_early_disconnection_flag
		set_country_flag = enserfed_peasants
	}
	on_revoked = {
		unblock_estate_removing_reforms = {
			estate = estate_nobles
		}
		clr_country_flag = enserfed_peasants
		if = {
			limit = { is_revolutionary = yes }
			country_event = {
				id = flavor_rus.398
			}
		}
	}
	on_invalid = {
		unblock_estate_removing_reforms = {
			estate = estate_nobles
		}
		clr_country_flag = enserfed_peasants
		if = {
			limit = { is_revolutionary = yes }
			country_event = {
				id = flavor_rus.398
			}
		}
	}
	benefits = {
		nobles_privilege_slots = 1
		war_taxes_cost_modifier = -0.5
		global_manpower_modifier = 0.1
		global_unrest = -1
	}
	penalties = {
		global_institution_spread = -0.2
		monthly_russian_modernization = -0.5
	}
	conditional_modifier = {
		trigger = { has_country_flag = rus_buffed_serfdom_privileges }
		modifier = {
			global_monthly_devastation = -0.05
		}
	}
	ai_will_do = {
		factor = 1
	}
}

estate_nobles_legalized_serfdom = {
	icon = privilege_serf
	loyalty = 0.15
	influence = 0.1
	max_absolutism = 0
	is_valid = {
		has_dlc = "Domination"
		OR = {
			has_reform = principality
			has_reform = veche_republic
			has_reform = tsardom
			has_reform = russian_empire_reform
			has_reform = great_veche_republic
			has_reform = great_russian_republic_reform
		}
		OR = {
			has_estate_privilege = estate_nobles_legalized_serfdom
			has_country_flag = level_two_serfdom_privileges
		}
		NOT = { has_country_flag = liberated_peasants }
		NOT = { has_country_flag = level_three_serfdom_privileges }
		NOT = { has_country_flag = final_serfdom_privileges }
	}
	can_revoke = no
	on_granted = {
		custom_tooltip = estate_privilege_cannot_be_revoked
		block_estate_removing_reforms = {
			estate = estate_nobles
		}
		set_country_flag = rus_enacted_early_serfdom_flag
		clr_country_flag = rus_enacted_early_disconnection_flag
		set_country_flag = enserfed_peasants
	}
	on_revoked = {
		unblock_estate_removing_reforms = {
			estate = estate_nobles
		}
		clr_country_flag = enserfed_peasants
		if = {
			limit = { is_revolutionary = yes }
			country_event = {
				id = flavor_rus.398
			}
		}
	}
	on_invalid = {
		unblock_estate_removing_reforms = {
			estate = estate_nobles
		}
		clr_country_flag = enserfed_peasants
		if = {
			limit = { is_revolutionary = yes }
			country_event = {
				id = flavor_rus.398
			}
		}
	}
	benefits = {
		nobles_privilege_slots = 1
		war_taxes_cost_modifier = -0.5
		global_manpower_modifier = 0.2
	}
	penalties = {
		global_institution_spread = -0.2
		technology_cost = 0.05
		idea_cost = 0.05
		monthly_russian_modernization = -0.5
	}
	conditional_modifier = {
		trigger = { has_country_flag = rus_buffed_serfdom_privileges }
		modifier = {
			global_monthly_devastation = -0.05
		}
	}
	ai_will_do = {
		factor = 1
	}
}

estate_nobles_total_serfdom = {
	icon = privilege_serf
	loyalty = 0.15
	influence = 0.1
	max_absolutism = 0
	is_valid = {
		has_dlc = "Domination"
		OR = {
			has_reform = principality
			has_reform = veche_republic
			has_reform = tsardom
			has_reform = russian_empire_reform
			has_reform = great_veche_republic
			has_reform = great_russian_republic_reform
		}
		OR = {
			has_estate_privilege = estate_nobles_total_serfdom
			has_country_flag = level_three_serfdom_privileges
		}
		NOT = { has_country_flag = liberated_peasants }
		NOT = { has_country_flag = final_serfdom_privileges }
	}
	can_revoke = no
	on_granted = {
		custom_tooltip = estate_privilege_cannot_be_revoked
		block_estate_removing_reforms = {
			estate = estate_nobles
		}
		set_country_flag = rus_enacted_early_serfdom_flag
		clr_country_flag = rus_enacted_early_disconnection_flag
		set_country_flag = enserfed_peasants
	}
	on_invalid = {
		unblock_estate_removing_reforms = {
			estate = estate_nobles
		}
		clr_country_flag = enserfed_peasants
		if = {
			limit = { is_revolutionary = yes }
			country_event = {
				id = flavor_rus.398
			}
		}
	}
	on_revoked = {
		unblock_estate_removing_reforms = {
			estate = estate_nobles
		}
		clr_country_flag = enserfed_peasants
		if = {
			limit = { is_revolutionary = yes }
			country_event = {
				id = flavor_rus.398
			}
		}
	}
	benefits = {
		nobles_privilege_slots = 1
		war_taxes_cost_modifier = -1
		global_manpower_modifier = 0.25
	}
	penalties = {
		global_institution_spread = -0.2
		technology_cost = 0.1
		idea_cost = 0.1
		monthly_russian_modernization = -1
	}
	conditional_modifier = {
		trigger = { has_country_flag = rus_buffed_serfdom_privileges }
		modifier = {
			global_monthly_devastation = -0.05
		}
	}
	ai_will_do = {
		factor = 1
	}
}

estate_nobles_restricted_serfdom = {
	icon = privilege_serf
	loyalty = 0.05
	influence = 0.1
	max_absolutism = 0
	is_valid = {
		has_dlc = "Domination"
		OR = {
			has_reform = principality
			has_reform = veche_republic
			has_reform = tsardom
			has_reform = russian_empire_reform
			has_reform = great_veche_republic
			has_reform = great_russian_republic_reform
		}
		has_estate_privilege = estate_nobles_restricted_serfdom
		NOT = { has_country_flag = liberated_peasants }
	}
	can_revoke = no
	on_granted = {
		custom_tooltip = estate_privilege_cannot_be_revoked
		block_estate_removing_reforms = {
			estate = estate_nobles
		}
		set_country_flag = rus_enacted_early_serfdom_flag
		clr_country_flag = rus_enacted_early_disconnection_flag
		set_country_flag = enserfed_peasants
	}
	on_revoked = {
		unblock_estate_removing_reforms = {
			estate = estate_nobles
		}
		clr_country_flag = enserfed_peasants
		if = {
			limit = { is_revolutionary = yes }
			country_event = {
				id = flavor_rus.398
			}
		}
	}
	on_invalid = {
		unblock_estate_removing_reforms = {
			estate = estate_nobles
		}
		clr_country_flag = enserfed_peasants
		if = {
			limit = { is_revolutionary = yes }
			country_event = {
				id = flavor_rus.398
			}
		}
	}
	benefits = {
		nobles_privilege_slots = 1
		global_unrest = -1
		global_manpower_modifier = 0.1
	}
	penalties = {
		global_institution_spread = -0.2
		technology_cost = 0.1
		idea_cost = 0.1
		monthly_russian_modernization = -0.25
	}
	conditional_modifier = {
		trigger = { has_country_flag = rus_buffed_serfdom_privileges }
		modifier = {
			global_monthly_devastation = -0.05
		}
	}
	ai_will_do = {
		factor = 1
	}
}

estate_nobles_devastating_serfdom = {
	icon = privilege_serf
	loyalty = 0.05
	influence = 0.15
	max_absolutism = 0
	is_valid = {
		has_dlc = "Domination"
		OR = {
			has_reform = principality
			has_reform = veche_republic
			has_reform = tsardom
			has_reform = russian_empire_reform
			has_reform = great_veche_republic
			has_reform = great_russian_republic_reform
		}
		has_estate_privilege = estate_nobles_devastating_serfdom
		NOT = { has_country_flag = liberated_peasants }
	}
	can_revoke = no
	on_granted = {
		custom_tooltip = estate_privilege_cannot_be_revoked
		block_estate_removing_reforms = {
			estate = estate_nobles
		}
		set_country_flag = rus_enacted_early_serfdom_flag
		clr_country_flag = rus_enacted_early_disconnection_flag
		set_country_flag = enserfed_peasants
	}
	on_revoked = {
		unblock_estate_removing_reforms = {
			estate = estate_nobles
		}
		clr_country_flag = enserfed_peasants
		if = {
			limit = { is_revolutionary = yes }
			country_event = {
				id = flavor_rus.398
			}
		}
	}
	on_invalid = {
		unblock_estate_removing_reforms = {
			estate = estate_nobles
		}
		clr_country_flag = enserfed_peasants
		if = {
			limit = { is_revolutionary = yes }
			country_event = {
				id = flavor_rus.398
			}
		}
	}
	benefits = {
		nobles_privilege_slots = 1
		global_unrest = -2
		global_manpower_modifier = 0.33
	}
	penalties = {
		development_cost = 0.25
		global_institution_spread = -0.5
		technology_cost = 0.15
		idea_cost = 0.15
		monthly_russian_modernization = -1
	}
	conditional_modifier = {
		trigger = { has_country_flag = rus_buffed_serfdom_privileges }
		modifier = {
			global_monthly_devastation = -0.05
		}
	}
	ai_will_do = {
		factor = 1
	}
}

estate_nobles_increased_peasant_freedom = {
	icon = privilege_peasant
	loyalty = -0.1
	influence = 0
	max_absolutism = -5
	conditional_modifier = { trigger = { has_absolutism_reduction_for_estate_privileges = yes } modifier = { max_absolutism = 1 } }
	is_valid = {
		has_dlc = "Domination"
		OR = {
			has_reform = principality
			has_reform = veche_republic
			has_reform = tsardom
			has_reform = russian_empire_reform
			has_reform = great_veche_republic
			has_reform = great_russian_republic_reform
		}
		NOT = { has_country_flag = level_two_serfdom_privileges }
		NOT = { has_country_flag = enserfed_peasants }
	}
	can_select = {
		NOT = { has_estate_privilege = estate_nobles_early_serfdom }
	}
	can_revoke = no
	on_granted = {
		custom_tooltip = estate_privilege_cannot_be_revoked
		block_estate_removing_reforms = {
			estate = estate_nobles
		}
		country_event = {
			id = flavor_rus.303
		}
		set_country_flag = rus_enacted_early_disconnection_flag
		set_country_flag = rus_peasant_fate
		clr_country_flag = rus_enacted_early_serfdom_flag
		set_country_flag = liberated_peasants
	}
	on_revoked = {
		unblock_estate_removing_reforms = {
			estate = estate_nobles
		}
		clr_country_flag = liberated_peasants
		if = {
			limit = { is_revolutionary = yes }
			country_event = {
				id = flavor_rus.399
			}
		}
	}
	on_invalid = {
		unblock_estate_removing_reforms = {
			estate = estate_nobles
		}
		clr_country_flag = liberated_peasants
		if = {
			limit = { is_revolutionary = yes }
			country_event = {
				id = flavor_rus.399
			}
		}
	}
	benefits = {
		nobles_privilege_slots = 1
		russian_modernization_gain_modifier = 0.1
		global_institution_spread = 0.1
		monthly_russian_modernization = 0.5
	}
	penalties = {
		global_manpower_modifier = -0.2
	}
	conditional_modifier = {
		trigger = { has_country_flag = rus_buffed_free_peasantry_privileges }
		modifier = {
			global_trade_power = 0.1
		}
	}
	ai_will_do = {
		factor = 1
	}
}

estate_nobles_peasant_liberation = {
	icon = privilege_peasant
	loyalty = -0.15
	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"
		OR = {
			has_reform = principality
			has_reform = veche_republic
			has_reform = tsardom
			has_reform = russian_empire_reform
			has_reform = great_veche_republic
			has_reform = great_russian_republic_reform
		}
		has_country_flag = level_two_serfdom_privileges
		NOT = { has_country_flag = enserfed_peasants }
	}
	can_revoke = no
	on_granted = {
		custom_tooltip = estate_privilege_cannot_be_revoked
		block_estate_removing_reforms = {
			estate = estate_nobles
		}
		set_country_flag = rus_enacted_early_disconnection_flag
		clr_country_flag = rus_enacted_early_serfdom_flag
		set_country_flag = liberated_peasants
	}
	on_revoked = {
		unblock_estate_removing_reforms = {
			estate = estate_nobles
		}
		clr_country_flag = liberated_peasants
		if = {
			limit = { is_revolutionary = yes }
			country_event = {
				id = flavor_rus.399
			}
		}
	}
	on_invalid = {
		unblock_estate_removing_reforms = {
			estate = estate_nobles
		}
		clr_country_flag = liberated_peasants
		if = {
			limit = { is_revolutionary = yes }
			country_event = {
				id = flavor_rus.399
			}
		}
	}
	benefits = {
		nobles_privilege_slots = 1
		russian_modernization_gain_modifier = 0.1
		global_institution_spread = 0.2
		monthly_russian_modernization = 0.75
	}
	penalties = {
		global_manpower_modifier = -0.2
	}
	conditional_modifier = {
		trigger = { has_country_flag = rus_buffed_free_peasantry_privileges }
		modifier = {
			global_trade_power = 0.1
		}
	}
	ai_will_do = {
		factor = 1
	}
}

estate_nobles_factionalist_nobility = {
	icon = estate_nobles_factionalist_nobility
	loyalty = -0.05
	influence = 0.1
	max_absolutism = -10
	conditional_modifier = { trigger = { has_absolutism_reduction_for_estate_privileges = yes } modifier = { max_absolutism = 2 } }
	is_valid = {
		has_dlc = "Domination"
		tag = CAS
	}
	can_revoke = {
		crown_land_share = 50 
	}
	on_granted = {
		
	}
	on_revoked = {
		
	}
	benefits = {
		
	}
	penalties = {
		legitimacy = -0.5
		global_autonomy = 0.05
		
	}
	conditional_modifier = {
		trigger = { 
			has_country_flag = cas_royalist_flag
		}
		modifier = {
			global_autonomy = -0.025
			legitimacy = 0.25
			nobles_loyalty_modifier = 0.05
		}
	}
	conditional_modifier = {
		trigger = { 
			has_country_flag = cas_infantes_flag
		}
		modifier = {
			reform_progress_growth = -0.1
		}
	}
	ai_will_do = {
		factor = 1
	}#TODO
}
estate_nobles_consolidated_noble_contracts = {
	icon = privilege_centralized
	loyalty = 0.05
	influence = 0.1
	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_nobles_consolidated_noble_contracts }
		has_dlc = "Domination" 
		NOT = { absolutism = 50 }
	}
	on_granted = {
	}
	on_revoked = {
	}
	benefits = {
		core_creation = -0.1
	}
	penalties = { 
	}
	conditional_modifier = {
		trigger = {
			is_at_war = yes 
		}
		modifier = {
			war_exhaustion = -0.05
			war_taxes_cost_modifier = -0.5
			nobles_influence_modifier = 0.1
		}
	}
	mechanics = {
		exempt_from_seize_land
	}
	ai_will_do = {
		factor = 1
	}
}

#England
estate_nobles_english_villeinage = {
	icon = privilege_serf
	loyalty = 0
	influence = 0.2
	max_absolutism = -5
	conditional_modifier = { trigger = { has_absolutism_reduction_for_estate_privileges = yes } modifier = { max_absolutism = 1 } }
	is_valid = {
		has_dlc = "Domination"
		has_estate_privilege = estate_nobles_english_villeinage
	}
	can_revoke = {
		OR = {
			crown_land_share = 40
			AND = {
				crown_land_share = 30
				has_estate_privilege = estate_church_religious_state
				has_estate_privilege = estate_nobles_nobility_primacy
				has_estate_privilege = estate_burghers_land_of_commerce
			}
		}
	}
	on_granted = {
	}
	on_revoked = {
	}
	modifier_by_land_ownership = {
		global_tax_modifier = -0.5
	}
	mechanics = {
		exempt_from_seize_land
		no_estate_crownland_loss_from_developing
	}
	ai_will_do = {
		factor = 1
	}
}

estate_nobles_english_copyhold_tenure = {
	icon = privilege_land_rights
	loyalty = 0.1
	influence = 0.1
	max_absolutism = -5
	conditional_modifier = { trigger = { has_absolutism_reduction_for_estate_privileges = yes } modifier = { max_absolutism = 1 } }
	is_valid = {
		has_dlc = "Domination"
		has_unlocked_estate_privilege = {
			estate_privilege = estate_nobles_english_copyhold_tenure
		}
	}
	can_revoke = {
		
	}
	on_granted = {
	}
	on_revoked = {
	}
	benefits = {
		global_tax_modifier = 0.1
	}
	modifier_by_land_ownership = {
		production_efficiency = 0.2
		nobles_loyalty_modifier = -0.2
	}
	mechanics = {
	}
	ai_will_do = {
		factor = 1
	}
}

#Domination generic Estate Privileges
estate_nobles_development_of_castles = {
	icon = privilege_fort
	loyalty = 0.1
	influence = 0.05
	max_absolutism = -5
	conditional_modifier = { trigger = { has_absolutism_reduction_for_estate_privileges = yes } modifier = { max_absolutism = 1 } }
	conditional_modifier = {
		trigger = {
			has_country_flag = ITA_upgrade_the_expand_the_fortifications_privilege_flag
		}
		modifier = {
			garrison_size = 0.1
			max_absolutism = 5
		}
	}
	conditional_modifier = {
		trigger = {
			has_country_flag = TIM_upgrade_expand_the_fortifications_flag
		}
		modifier = {
			defensiveness = 0.05 
			fort_maintenance_modifier = -0.05
		}
	}
	is_valid = {
		has_dlc = "Domination"
	}
	on_granted = {
		custom_tooltip = estate_nobles_development_of_castles_gt
		tooltip = {
			add_province_modifier = {
				name = estate_nobles_development_of_castles_mod
				duration = -1
			}
		}
		custom_tooltip = estate_nobles_development_of_castles_at
		tooltip = {
			add_province_modifier = {
				name = estate_nobles_development_of_castles_ramparts_mod
				duration = -1
			}
		}
	}
	on_revoked = {
		custom_tooltip = estate_nobles_development_of_castles_rt
	}
	on_granted_province = {
		if = {
			limit = {
				has_fort_building_trigger = yes
			}
			add_province_modifier = {
				name = estate_nobles_development_of_castles_mod
				duration = -1
			}
		}
		if = {
			limit = {
				has_building = ramparts
			}
			add_province_modifier = {
				name = estate_nobles_development_of_castles_ramparts_mod
				duration = -1
			}
		}
	}
	on_invalid_province = {
		if = {
			limit = { has_province_modifier = estate_nobles_development_of_castles_mod }
			remove_province_modifier = estate_nobles_development_of_castles_mod
		}
		if = {
			limit = { has_province_modifier = estate_nobles_development_of_castles_ramparts_mod }
			remove_province_modifier = estate_nobles_development_of_castles_ramparts_mod
		}
	}
	on_revoked_province = {
		if = {
			limit = { has_province_modifier = estate_nobles_development_of_castles_mod }
			remove_province_modifier = estate_nobles_development_of_castles_mod
		}
		if = {
			limit = { has_province_modifier = estate_nobles_development_of_castles_ramparts_mod }
			remove_province_modifier = estate_nobles_development_of_castles_ramparts_mod
		}
	}

	mechanics = {
		no_estate_crownland_loss_from_developing
	}
	conditional_modifier = {
		trigger = { has_government_mechanic = russian_modernization_mechanic }
		modifier = { monthly_russian_modernization = -0.05 }
	}
	#conditional_modifier = {
	#	trigger = { has_government_mechanic = ottoman_decadence_mechanic }
	#	modifier = { monthly_ottoman_decadence = 0.02 }
	#}
	ai_will_do = {
		factor = 0
	}
}
estate_nobles_statesman_servitude = {
	icon = privilege_diplomat
	loyalty = 0.0
	influence = 0.05
	max_absolutism = -5
	conditional_modifier = { trigger = { has_absolutism_reduction_for_estate_privileges = yes } modifier = { max_absolutism = 1 } }
	conditional_modifier = {
		trigger = {
			has_country_flag = GER_upgrade_the_statesman_privilege_flag 
		}
		modifier = {
			max_absolutism = 5
		}
	}
	is_valid = {
		has_dlc = "Domination"
	}
	can_select = {
	}
	on_granted = {
		enable_estate_action = {
			estate_action = RECRUIT_MINISTER_NOBLES
		}
	}
	on_revoked = {
		disable_estate_action = {
			estate_action = RECRUIT_MINISTER_NOBLES
		}
	}
	on_invalid = {
		disable_estate_action = {
			estate_action = RECRUIT_MINISTER_NOBLES
		}
	}
	conditional_modifier = {
		trigger = { has_government_mechanic = russian_modernization_mechanic }
		modifier = { monthly_russian_modernization = -0.05 }
	}
	#conditional_modifier = {
	#	trigger = { has_government_mechanic = ottoman_decadence_mechanic }
	#	modifier = { monthly_ottoman_decadence = 0.02 }
	#}
	ai_will_do = {
		factor = 0
	}
}
estate_nobles_royal_court_tasks = {
	icon = privilege_build_jain_temple
	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_privilege = estate_rajput_royal_court_tasks }
			NOT = { has_estate_privilege = estate_rajput_royal_court_tasks }
		}
		if = {
			limit = { has_estate_privilege = estate_maratha_royal_court_tasks }
			NOT = { has_estate_privilege = estate_maratha_royal_court_tasks }
		}
	}
	on_granted = {
		scaling_with_influence_privilege_tooltip = {
			estate_privilege = estate_nobles_royal_court_tasks
		}
	}
	on_revoked = {
		scaling_with_influence_privilege_tooltip = {
			estate_privilege = estate_nobles_royal_court_tasks
		}
	}
	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_nobles
					loyalty = 30
				}
			}
		}
		modifier = {
			prestige_decay = 0.01
		}
	}
	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_nobles
				loyalty = 30
			}
			NOT = {
				estate_loyalty = {
					estate = estate_nobles
					loyalty = 60
				}
			}
		}
		modifier = {
			prestige_decay = -0.005
		}
	}
	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_nobles
				loyalty = 60
			}
		}
		modifier = {
			prestige_decay = -0.01
		}
	}
	conditional_modifier = {
		trigger = { has_government_mechanic = russian_modernization_mechanic }
		modifier = { monthly_russian_modernization = -0.05 }
	}
	#conditional_modifier = {
	#	trigger = { has_government_mechanic = ottoman_decadence_mechanic }
	#	modifier = { monthly_ottoman_decadence = 0.02 }
	#}
	ai_will_do = {
		factor = 0
	}
}
estate_nobles_diet_right = {
	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"
	}
	on_granted = {
		enable_estate_action = {
			estate_action = CALL_DIET_NOBLES
		}
	}
	on_invalid = {
		disable_estate_action = {
			estate_action = CALL_DIET_NOBLES
		}
	}
	on_revoked = {
		disable_estate_action = {
			estate_action = CALL_DIET_NOBLES
		}
	}
	mechanics = {
	}
	conditional_modifier = {
		trigger = { has_government_mechanic = russian_modernization_mechanic }
		modifier = { monthly_russian_modernization = -0.05 }
	}
	#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_nobles_force_conscription = {
	icon = privilege_land_force_limit
	loyalty = 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 = DEMAND_MORE_TROOPS_NOBLES
		}
	}
	on_revoked = {
		disable_estate_action = {
			estate_action = DEMAND_MORE_TROOPS_NOBLES
		}
	}
	on_invalid = {
		disable_estate_action = {
			estate_action = DEMAND_MORE_TROOPS_NOBLES
		}
	}
	conditional_modifier = {
		trigger = { has_government_mechanic = russian_modernization_mechanic }
		modifier = { monthly_russian_modernization = -0.05 }
	}
	#conditional_modifier = {
	#	trigger = { has_government_mechanic = ottoman_decadence_mechanic }
	#	modifier = { monthly_ottoman_decadence = 0.02 }
	#}
	ai_will_do = {
		factor = 0
	}
}
estate_nobles_noble_officer_right = {
	icon = privilege_army_tradition
	loyalty = 0.0
	influence = 0.1
	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_rajput }
			NOT = { has_estate_privilege = estate_rajput_force_conscription }
		}
		if = {
			limit = { has_estate = estate_maratha }
			NOT = { has_estate_privilege = estate_maratha_force_conscription }
		}
	}
	on_granted = {
		enable_estate_action = {
			estate_action = GRANT_GENERALSHIP_NOBLES
		}
	}
	on_invalid = {
		disable_estate_action = {
			estate_action = GRANT_GENERALSHIP_NOBLES
		}
	}
	on_revoked = {
		disable_estate_action = {
			estate_action = GRANT_GENERALSHIP_NOBLES
		}
	}
	conditional_modifier = {
		trigger = { has_government_mechanic = russian_modernization_mechanic }
		modifier = { monthly_russian_modernization = -0.05 }
	}
	#conditional_modifier = {
	#	trigger = { has_government_mechanic = ottoman_decadence_mechanic }
	#	modifier = { monthly_ottoman_decadence = 0.02 }
	#}
	ai_will_do = {
		factor = 0
	}
}
estate_nobles_expedition_rights = {
	icon = privilege_conquistador
	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"
		has_any_exploration_idea = yes
	}
	loyalty_scaled_conditional_modifier = {
		trigger = {
			always = yes
		}
		modifier = {
			colony_cost_modifier = -0.5
		}
	}
	
	on_granted = {
		scaling_with_loyalty_privilege_tooltip = {
			estate_privilege = estate_nobles_expedition_rights
		}
		enable_estate_action = {
			estate_action = RECRUIT_CONQUISTADOR_ESTATES_NOBLES
		}
	}
	on_invalid = {
		scaling_with_loyalty_privilege_tooltip = {
			estate_privilege = estate_nobles_expedition_rights
		}
		disable_estate_action = {
			estate_action = RECRUIT_CONQUISTADOR_ESTATES_NOBLES
		}
	}
	on_revoked = {
		scaling_with_loyalty_privilege_tooltip = {
			estate_privilege = estate_nobles_expedition_rights
		}
		disable_estate_action = {
			estate_action = RECRUIT_CONQUISTADOR_ESTATES_NOBLES
		}
	}
	conditional_modifier = {
		trigger = { has_government_mechanic = russian_modernization_mechanic }
		modifier = { monthly_russian_modernization = -0.05 }
	}
	#conditional_modifier = {
	#	trigger = { has_government_mechanic = ottoman_decadence_mechanic }
	#	modifier = { monthly_ottoman_decadence = 0.02 }
	#}
	ai_will_do = {
		factor = 0
	}
}

#1.36 Georgia 

estate_nobles_highland_fortifications = {
	icon = privilege_fort
	max_absolutism = -5
	loyalty = 0.05
	influence = 0.05
	is_valid = {
		OR = {
			has_mission = geo_fortify_caucasia
			has_unlocked_estate_privilege = {
				estate_privilege = estate_nobles_highland_fortifications
			}
		}
	}
	can_select = {
		custom_trigger_tooltip = {
			tooltip = has_unlocked_estate_nobles_highland_fortifications_tt
			has_unlocked_estate_privilege = {
				estate_privilege = estate_nobles_highland_fortifications
			}	
		}
		any_owned_province = {
			has_terrain = mountain
			has_fort_building_trigger = yes
		}
	}
	on_granted = {
		custom_tooltip = estate_nobles_highland_fortifications_tt
	}
	on_granted_province = {
		if = {
			limit = {
				has_terrain = mountain
				has_fort_building_trigger = yes
			}
			add_province_modifier = {
				name = geo_privilege_mountains
				duration = -1
			}
		}
	}
	on_revoked = {
		custom_tooltip = estate_nobles_highland_fortifications_revoke
	}
	on_revoked_province = {
		if = {
			limit = {
				has_province_modifier = geo_privilege_mountains
			}
			remove_province_modifier = geo_privilege_mountains
		}
	}
	on_invalid = {
	}
	on_invalid_province = {
		if = {
			limit = {
				has_province_modifier = geo_privilege_mountains
			}
			remove_province_modifier = geo_privilege_mountains
		}
	}
	ai_will_do = {
		factor = 1
	}
}

#Turkomen

estate_nobles_emirs_of_baghdad = {
	icon = privilege_build_jain_temple
	land_share = 0
	max_absolutism = -15
	loyalty = 0.1
	influence = 0.1
	is_valid = {
		OR = {
			tag = QAR
			was_tag = QAR
		}
	}
	can_select = {
	}
	on_granted = {
		custom_tooltip = estate_nobles_emirs_of_baghdad_tt_granted
		hidden_effect = {
			every_owned_province = {
				limit = {
					OR = {
						area = iraq_arabi_area
						area = basra_area
						area = al_jazira_area
					}
				}
				add_province_modifier = {
					name = "turkoman_emirs_of_baghdad"
					duration = -1
				}
			}
		}
	}
	can_revoke = no
	on_granted_province = {
	}
	on_revoked = {
		custom_tooltip = estate_nobles_emirs_of_baghdad_tt_revoked
		hidden_effect = {
			every_owned_province = {
				limit = {
					has_province_modifier = turkoman_emirs_of_baghdad
				}
				remove_province_modifier = turkoman_emirs_of_baghdad
			}
		}
	}
	on_revoked_province = {
	}
	on_invalid = {
		every_owned_province = {
			limit = {
				has_province_modifier = turkoman_emirs_of_baghdad
			}
			remove_province_modifier = turkoman_emirs_of_baghdad
		}
	}
	on_invalid_province = {
	}
	ai_will_do = {
		factor = 1
	}
}

#Byzantium
estate_nobles_deteriorating_army = {
	icon = estate_nobles_deteriorating_army
	loyalty = -0.05
	influence = 0.1
	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_nobles_deteriorating_army
		}
		NOT = { has_country_flag = estate_nobles_deteriorating_army_removed }
	}
	can_revoke = {
		custom_trigger_tooltip = {
			tooltip = BYZ_revokable_via_decision
			always = no
		}
	}
	on_granted = {
	}
	on_revoked = {
		set_country_flag = estate_nobles_deteriorating_army_removed
	}
	benefits = {
		
	}
	penalties = {
		assault_fort_ability = -0.75
		reinforce_speed = -0.1
		army_tradition_decay = 0.01
	}
	conditional_modifier = {
		trigger = {
			has_dlc = "King of Kings"
		}
		is_bad = yes
		modifier = {
			land_morale = -0.15 #this is counteracted by the +10.0% from the mission tree and events
		}
	}
	ai_will_do = {
		factor = 0
	}
}

#Persia
estate_nobles_defensive_policy = {
	icon = privilege_fort
	loyalty = 0.05
	influence = 0.1
	max_absolutism = 0
	#conditional_modifier = { trigger = { has_absolutism_reduction_for_estate_privileges = yes } modifier = { max_absolutism = 1 } }
	is_valid = {
		has_unlocked_estate_privilege = {
			estate_privilege = estate_nobles_defensive_policy
		}
	}
	can_select = {
		NOT = { has_estate_privilege = estate_qizilbash_defensive_policy }
		NOT = { has_estate_privilege = estate_ghulams_defensive_policy }
	}
	on_granted = {
		
	}
	on_revoked = {
		
	}
	benefits = {
		garrison_size = 0.25
		fort_maintenance_modifier = -0.33
	}
	ai_will_do = {
		factor = 0
	}
}

estate_nobles_tofangchi_regiment = {
	icon = privilege_infantry
	loyalty = 0.05
	influence = 0.1
	max_absolutism = 0
	#conditional_modifier = { trigger = { has_absolutism_reduction_for_estate_privileges = yes } modifier = { max_absolutism = 1 } }
	is_valid = {
		has_unlocked_estate_privilege = {
			estate_privilege = estate_nobles_tofangchi_regiment
		}
	}
	can_select = {
		NOT = { has_estate_privilege = estate_qizilbash_tofangchi_regiment }
		NOT = { has_estate_privilege = estate_ghulams_tofangchi_regiment }
	}
	on_granted = {
		
	}
	on_revoked = {
		
	}
	benefits = {
		infantry_power = 0.1
	}
	ai_will_do = {
		factor = 100
	}
}

estate_nobles_tupchi_artillery_corps = {
	icon = privilege_artillery
	loyalty = 0.05
	influence = 0.05
	max_absolutism = -5
	conditional_modifier = { trigger = { has_absolutism_reduction_for_estate_privileges = yes } modifier = { max_absolutism = 1 } }
	is_valid = {
		has_unlocked_estate_privilege = {
			estate_privilege = estate_nobles_tupchi_artillery_corps
		}
	}
	can_select = {
		NOT = { has_estate_privilege = estate_qizilbash_tupchi_artillery_corps }
		NOT = { has_estate_privilege = estate_ghulams_tupchi_artillery_corps }
	}
	on_granted = {
		custom_tooltip = tupchi_artillery_corps_tt
	}
	on_revoked = {
		
	}
	conditional_modifier = {
		trigger = {
			OR = {
				any_ally = {
					OR = {
						technology_group = western
						technology_group = eastern
						capital_scope = { continent = europe }
					}
				}
				any_subject_country = {
					OR = {
						technology_group = western
						technology_group = eastern
						capital_scope = { continent = europe }
					}
				}
			}
		}
		modifier = {
			artillery_cost = -0.33
		}
	}
	benefits = {
		artillery_power = 0.05
	}
	ai_will_do = {
		factor = 100
	}
}

estate_nobles_qurchi_service = {
	icon = privilege_legitimacy
	loyalty = 0.10
	max_absolutism = 0
	#conditional_modifier = { trigger = { has_absolutism_reduction_for_estate_privileges = yes } modifier = { max_absolutism = 1 } }
	is_valid = {
		has_unlocked_estate_privilege = {
			estate_privilege = estate_nobles_qurchi_service
		}
	}
	can_select = {
		NOT = { has_estate_privilege = estate_ghulams_qurchi_service }
		NOT = { has_estate_privilege = estate_qizilbash_qurchi_service }
	}
	on_granted = {
		scaling_with_loyalty_privilege_tooltip = {
			estate_privilege = estate_nobles_qurchi_service
		}
	}
	on_revoked = {
		scaling_with_loyalty_privilege_tooltip = {
			estate_privilege = estate_nobles_qurchi_service
		}
	}
	benefits = {
		morale_damage_received = -0.1
	}
	loyalty_scaled_conditional_modifier = {
		trigger = { always = yes }
		modifier = {
			monarch_lifespan = 0.5
			nobles_influence_modifier = 0.5
			qizilbash_influence_modifier = -0.5
			ghulams_influence_modifier = -0.5
		}
	}
	ai_will_do = {
		factor = 100
	}
}

estate_nobles_mamlukian_administration = {
	icon = privilege_land_rights
	loyalty = 0.05
	influence = 0.10
	max_absolutism = 0
	#conditional_modifier = { trigger = { has_absolutism_reduction_for_estate_privileges = yes } modifier = { max_absolutism = 1 } }
	is_valid = {
		has_unlocked_estate_privilege = {
			estate_privilege = estate_nobles_mamlukian_administration
		}
	}
	can_select = {
		NOT = { has_estate_privilege = estate_ghulams_mamlukian_administration }
		NOT = { has_estate_privilege = estate_qizilbash_mamlukian_administration }
	}
	benefits = {
		governing_capacity_modifier = 0.1
		nobles_privilege_slots = 1
	}
	on_granted = {
		custom_tooltip = mamlukian_administration_modifier_gt
		tooltip = {
			add_province_modifier = {
				name = mamlukian_administration_modifier
				duration = -1
			}
		}
	}
	on_revoked = {
		custom_tooltip = mamlukian_administration_modifier_rt
	}
	on_invalid = {
		custom_tooltip = mamlukian_administration_modifier_rt
	}
	on_granted_province = {
		if = {
			limit = { region = egypt_region }
			add_province_modifier = {
				name = mamlukian_administration_modifier
				duration = -1
			}
		}
	}
	on_revoked_province = {
		remove_province_modifier = mamlukian_administration_modifier
	}
	on_invalid_province = {
		remove_province_modifier = mamlukian_administration_modifier
	}
	ai_will_do = {
		factor = 100
	}
}

estate_nobles_enlist_the_mamluks = {
	icon = privilege_infantry
	loyalty = 0.1
	influence = 0.1
	max_absolutism = 0
	#conditional_modifier = { trigger = { has_absolutism_reduction_for_estate_privileges = yes } modifier = { max_absolutism = 1 } }
	is_valid = {
		OR = {
			is_or_was_tag = { tag = MAM }
			has_country_flag = enable_mamluk_privilege #For the modders
		}
		has_dlc = "King of Kings"
	}
	benefits = {
		has_mamluks = yes 
		allowed_mamluks_fraction = 0.2
	}
	ai_will_do = {
		factor = 100
	}
}

estate_nobles_ITA_military_governors = {
	icon = estate_nobles_ITA_military_governors
	loyalty = 0
	influence = 0.1
	max_absolutism = 0
	is_valid = {
		OR = {
			has_country_flag = ITA_enable_privilege_for_military_governors_flag
			tag = ROM 
			was_tag = ROM
		}
	}
	benefits = {
		state_governing_cost = -0.05
	}
	on_granted = {
		custom_tooltip = ITA_specify_the_conditional_effects
	}
	conditional_modifier = {
		trigger = {
			is_at_war = yes
		}
		modifier = {
			global_autonomy = -0.05 #halve the penalty
		}
	}
	conditional_modifier = {
		trigger = {
			has_country_flag = ITA_upgrade_military_governorship_with_autonomy_in_terr_flag
		}
		modifier = {
			min_autonomy_in_territories = -0.05
		}
	}
	conditional_modifier = {
		trigger = {
			has_country_flag = ITA_upgrade_military_governorship_with_abso_flag
		}
		modifier = {
			max_absolutism = 5
		}
	}
	conditional_modifier = {
		trigger = {
			has_country_flag = ITA_upgrade_military_governorship_with_army_quality_flag
		}
		modifier = {
			army_tradition = 1
			leader_land_shock = 1
		}
	}
	
	conditional_modifier = {
		trigger = {
			has_government_attribute = enables_pronoias #for roman empire specifically
		}
		modifier = {
			num_of_pronoiars = 1
		}
	}
	ai_will_do = {
		factor = 100
	}
}

estate_nobles_GER_diploma_andreanum = {
	icon = estate_nobles_GER_diploma_andreanum
	loyalty = 0.1
	influence = 0.05
	max_absolutism = -5
	is_valid = {
		has_country_flag = GER_unlock_diploma_andreanum_flag
	}
	benefits = {
		territories_governing_cost = -0.05
	}
	on_granted = {
		custom_tooltip = GER_low_average_autonomy_buff
	}
	conditional_modifier = {
		trigger = {
			NOT = { average_autonomy = 25 }
		}
		modifier = {
			manpower_in_accepted_culture_provinces = 0.1
		}
	}
	ai_will_do = {
		factor = 100
	}
}

estate_nobles_orangist_privileges = {
	icon = privilege_royal_authority
	max_absolutism = 5
	conditional_modifier = { trigger = { has_absolutism_reduction_for_estate_privileges = yes } modifier = { max_absolutism = 1 } }
	influence = 0.1
	is_valid = {
		has_country_flag = ned_buff_orangist_candidates_flag
	}
	on_granted = {
		custom_tooltip = NED_UNLOCK_OVERTHROW_STATIST_CANDIDATES
	}
	penalties = {
	
	}
	benefits = {
	}
	conditional_modifier = {
		trigger = { has_government_mechanic = russian_modernization_mechanic }
		modifier = { monthly_russian_modernization = -0.03 }
	}
	ai_will_do = {
		factor = 0
	}
}

estate_nobles_vegvar_system = {
	icon = estate_nobles_vegvar_system
	max_absolutism = -5
	loyalty = 0.1
	influence = 0.05
	is_valid = {
		has_unlocked_estate_privilege = {
			estate_privilege = estate_nobles_vegvar_system
		}
	}
	can_select = {
		any_owned_province = {
			any_neighbor_province = {
				NOT = { owned_by = ROOT }
			}
			has_fort_building_trigger = yes
		}
	}
	on_granted = {
		custom_tooltip = estate_nobles_vegvar_system_tt
		tooltip = {
			add_province_modifier = {
				name = estate_nobles_vegvar_system_modifier
				duration = -1
				desc = hun_vegvar_province_desc
			}
		}
	}
	on_granted_province = {
		if = {
			limit = {
				any_neighbor_province = {
					NOT = { owned_by = ROOT }
				}
				has_fort_building_trigger = yes
			}
			add_province_modifier = {
				name = estate_nobles_vegvar_system_modifier
				duration = -1
			}
		}
	}
	on_revoked = {
		custom_tooltip = estate_nobles_vegvar_system_rt
	}
	on_revoked_province = {
		if = {
			limit = { has_province_modifier = estate_nobles_vegvar_system_modifier }
			remove_province_modifier = estate_nobles_vegvar_system_modifier
		}
	}
	on_invalid = {
	}
	on_invalid_province = {
		if = {
			limit = { has_province_modifier = estate_nobles_vegvar_system_modifier }
			remove_province_modifier = estate_nobles_vegvar_system_modifier
		}
	}
	ai_will_do = {
		factor = 100
	}
}

estate_nobles_MAY_arm_nobles_with_obsidian_blades = {
	icon = privilege_macuahuitl
	max_absolutism = -5
	conditional_modifier = {
		trigger = {
			has_absolutism_reduction_for_estate_privileges = yes 
		} 
		modifier = { max_absolutism = 1 } 
	}
	conditional_modifier = {
		trigger = {
			has_country_flag = MAY_upgrade_obsidian_privilege_flag
		}
		modifier = { max_absolutism = 5 }
	}
	influence = 0.05
	loyalty = 0.1
	is_valid = {
		technology_group = mesoamerican
	}
	benefits = {
		infantry_cost = -0.05
	}
	on_granted = {
		if = {
			limit = {
				has_country_flag = azt_obsidian_blades_buff_flag
			}
			custom_tooltip = AZT_buffed_conditional_benefit_for_obsidian
		}
		else_if = {
			limit = {
				has_country_flag = MAY_upgrade_obsidian_privilege_flag
			}
			custom_tooltip = MAY_buffed_conditional_benefit_for_obsidian
		}
		else = {
			custom_tooltip = MAY_conditional_benefit_for_obsidian
		}
	}
	conditional_modifier = {
		trigger = {
			NOT = { has_country_flag = azt_obsidian_blades_buff_flag }
			NOT = { has_country_flag = MAY_upgrade_obsidian_privilege_flag }
			has_obsidian_source_trigger = yes
		}
		modifier = {
			infantry_power = 0.1
			nobles_influence_modifier = 0.05
		}
	}
	conditional_modifier = {
		trigger = {
			has_country_flag = MAY_upgrade_obsidian_privilege_flag
			has_obsidian_source_trigger = yes
		}
		modifier = {
			infantry_power = 0.1
		}
	}
	conditional_modifier = {
		trigger = {
			has_country_flag = azt_obsidian_blades_buff_flag
			has_obsidian_source_trigger = yes
		}
		modifier = {
			infantry_power = 0.15
			nobles_influence_modifier = 0.05
		}
	}
	ai_will_do = {
		factor = 100
		modifier = {
			factor = 0
			is_absolutism_active = yes
		}
	}
}

estate_nobles_MAY_spread_dynastic_influence = {
	icon = privilege_mayan_crown
	loyalty = 0
	influence = 0.1
	max_absolutism = -10
	conditional_modifier = { trigger = { has_absolutism_reduction_for_estate_privileges = yes } modifier = { max_absolutism = 2 } }
	is_valid = {
		has_country_flag = MAY_unlock_privilege_for_tributaries_flag
	}
	penalties = {
		reduced_liberty_desire = -10
	}
	benefits = {
		annexation_relations_impact = -0.25
	}
	on_granted = {
		custom_tooltip = MAY_benefits_of_dynastic_influence
	}
	ai_will_do = {
		factor = 1
	}
}

estate_nobles_AZT_triple_alliance = {
	icon = estate_burghers_monopoly_of_coffee
	loyalty = 0.05
	influence = 0.1
	max_absolutism = -5
	conditional_modifier = { trigger = { has_absolutism_reduction_for_estate_privileges = yes } modifier = { max_absolutism = 1 } }
	is_valid = {
		has_estate_privilege = estate_nobles_AZT_triple_alliance
	}
	can_select = {
	
	}
	benefits = {
		vassal_forcelimit_bonus = 1
		vassal_income = 0.3
		liberty_desire_from_subject_development = -0.25
	}
	conditional_modifier = {
		trigger = {
			NOT = { has_country_flag = azt_triple_alliance_buff }
		}
		modifier = {
			governing_capacity_modifier = -0.5
			governing_capacity = -100
		}
	}
	conditional_modifier = {
		trigger = {
			has_country_flag = azt_triple_alliance_buff
		}
		modifier = {
			governing_capacity_modifier = -0.25
		}
	}
	can_revoke = {
		custom_trigger_tooltip = {
			tooltip = AZT_revokable_via_mission
			always = no
		}
	}
	ai_will_do = {
		factor = 1
	}
}

estate_nobles_AZT_warrior_culture = {
	icon = privilege_demand_more_troops
	loyalty = 0.05
	influence = 0.1
	max_absolutism = -5
	conditional_modifier = { trigger = { has_absolutism_reduction_for_estate_privileges = yes } modifier = { max_absolutism = 1 } }
	is_valid = {
		has_country_flag = azt_military_culture_flag
	}
	
	on_granted = {
		custom_tooltip = AZT_grant_bonuses_to_culture_province
		tooltip	= {
			if = {
				limit = {
					has_country_flag = azt_buffed_military_society_flag
				}
				add_province_modifier = {
					name = azt_military_culture_modifier_buffed
					duration = -1
				}
			}
			else = {
				add_province_modifier = {
					name = azt_military_culture_modifier
					duration = -1
				}
			}
		}
	}
	
	on_granted_province = {
		hidden_effect = {
			if = {
				limit = {
					culture = ROOT
					owner = {
						NOT = { has_country_flag = azt_buffed_military_society_flag }
					}
				}
				add_province_modifier = {
					name = azt_military_culture_modifier
					duration = -1
				}
			}
			else_if = {
				limit = {
					culture = ROOT
					owner = {
						has_country_flag = azt_buffed_military_society_flag
					}
				}
				add_province_modifier = {
					name = azt_military_culture_modifier_buffed
					duration = -1
				}
			}
		}
	}
	
	on_revoked = {
		custom_tooltip = AZT_REVOKE_PRIVILEGE_BONUSES
		hidden_effect = {
			every_owned_province = {
				limit = {
					OR = {
						has_province_modifier = azt_military_culture_modifier
						has_province_modifier = azt_military_culture_modifier_buffed
					}
				}
				remove_province_modifier = azt_military_culture_modifier
				remove_province_modifier = azt_military_culture_modifier_buffed
			}
		}
	}
	
	ai_will_do = {
		factor = 1
	}
}


estate_nobles_reformatio_sigismundi = {
	icon = privilege_coup_detat
	max_absolutism = -10
	influence = 0.15
	loyalty = 0.10
	is_valid = {
		has_unlocked_estate_privilege = {
			estate_privilege = estate_nobles_reformatio_sigismundi
		}
		custom_trigger_tooltip = {
			tooltip = estate_nobles_reformatio_sigismundi_has_eligible_province_tt
			any_owned_province = {
				has_owner_accepted_culture = no
				culture_group = germanic
			}
		}
	}
	can_select = {
		custom_trigger_tooltip = {
			tooltip = has_unlocked_estate_nobles_reformatio_sigismundi
			has_unlocked_estate_privilege = {
				estate_privilege = estate_nobles_reformatio_sigismundi
			}
		}
		custom_trigger_tooltip = {
			tooltip = estate_nobles_reformatio_sigismundi_has_eligible_province_tt
			any_owned_province = {
				has_owner_accepted_culture = no
				culture_group = germanic
			}
		}
	}
	on_granted = {
		custom_tooltip = estate_nobles_reformatio_sigismundi_gt
	}
	on_granted_province = {
		if = {
			limit = {
				NOT = {
					has_owner_accepted_culture = yes
				}
				culture_group = germanic
			}
			add_province_modifier = {
				name = boh_cultural_integration
				duration = -1
			}
		}
		else_if = {
			limit = {
				has_province_modifier = boh_cultural_integration
			}
			remove_province_modifier = boh_cultural_integration
		}
	}
	on_revoked = {
		custom_tooltip = estate_nobles_reformatio_sigismundi_rk
	}
	on_revoked_province = {
		if = {
			limit = {
				has_province_modifier = boh_cultural_integration
			}
			remove_province_modifier = boh_cultural_integration
		}
	}
	on_invalid = {
	}
	on_invalid_province = {
		if = {
			limit = {
				has_province_modifier = boh_cultural_integration
			}
			remove_province_modifier = boh_cultural_integration
		}
	}
	penalties = {
	}
	benefits = {
	}
	ai_will_do = {
		factor = 1000
	}
}

estate_nobles_basqaq_autonomy = {
	icon = privilege_basqaqs
	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_basqaqs_unlocked_flag
	}
	can_select = {
		NOT = { has_estate_privilege = estate_nomadic_tribes_basqaq_autonomy }
	}
	penalties = {
		governing_capacity_modifier = -0.1
	}
	
	benefits = {
		monarch_power_tribute = 1
		manpower_recovery_speed = 0.10
	}
	ai_will_do = {
		factor = 0
	}
}

estate_nobles_imperial_war_leader = {
	icon = privilege_grant_autonomy
	max_absolutism = -5
	conditional_modifier = { trigger = { has_absolutism_reduction_for_estate_privileges = yes } modifier = { max_absolutism = 1 } }
	loyalty = 0.0
	influence = 0.05
	is_valid = {
		has_country_flag = hab_imperial_warleader_flag
	}
	can_select = {
	}
	on_granted = {
	}
	penalties = {
		relation_with_same_culture_group = -10
	}
	benefits = {
		army_tradition_from_battle = 0.5
		land_morale = 0.05
	}
	ai_will_do = {
		factor = 5
	}
}

estate_nobles_hab_habsburg_connections = {
	icon = privilege_grant_autonomy
	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 = {
		has_country_flag = hab_unlocked_habsburg_connections
	}
	can_select = {
	}
	on_granted = {
	}
	loyalty_scaled_conditional_modifier = {
		trigger = {
			always = yes
		}
		modifier = {
			country_diplomatic_power = 2
			diplomatic_reputation = 2
		}
	}
	ai_will_do = {
		factor = 5
	}
}

estate_nobles_habsburg_disunity = {
	icon = privilege_grant_autonomy
	max_absolutism = -5
	conditional_modifier = { trigger = { has_absolutism_reduction_for_estate_privileges = yes } modifier = { max_absolutism = 1 } }
	loyalty = 0
	influence = 0.05
	is_valid = {
		has_country_flag = hab_ladislaus_postumus_heir
		NOT = {
			has_country_flag = hab_united_habsburg_land
		}
	}
	can_select = {
	}
	penalties = {
		global_autonomy = 0.05
		global_tax_modifier = -0.1
	}
	can_revoke = {
		OR = {
			custom_trigger_tooltip = {
				tooltip = HAB_LADISLAUS_IS_RULER_OR_DEAD
				always = no
			}
			custom_trigger_tooltip = {
				tooltip = HAB_ENACTED_UNITE_HABSBURG_LANDS_DECISION
				always = no
			}
		}
	}
	ai_will_do = {
		factor = 5
	}
}

estate_nobles_melting_pot_of_cultures = {
	icon = privilege_grant_autonomy
	max_absolutism = -5
	conditional_modifier = { trigger = { has_absolutism_reduction_for_estate_privileges = yes } modifier = { max_absolutism = 1 } }
	loyalty = 0
	influence = 0.05
	is_valid = {
		has_country_flag = hab_melting_pot_flag
	}
	on_granted = {
		custom_tooltip = HAB_EXPLAIN_MODIFIERS_MELTING_POT
	}
	on_granted_province = {
		if = {
			limit = {
				OR = {
					culture = hungarian
					culture = transylvanian
				}
			}
			add_province_modifier = {
				name = hab_hungarian_province
				duration = -1
				hidden = yes
			}
		}
		else_if = {
			limit = {
				culture_group = west_slavic
			}
			add_province_modifier = {
				name = hab_west_slavic_province
				duration = -1
				hidden = yes
			}
		}
		else_if = {
			limit = {
				NOT = {
					culture_group = ROOT
					culture = hungarian
					culture = transylvanian
					culture_group = west_slavic
				}
			}
			add_province_modifier = {
				name = hab_minority_province
				duration = -1
				hidden = yes
			}
		}
	}

	on_revoked_province = {
		if = {
			limit = {
				has_province_modifier = hab_hungarian_province
			}
			remove_province_modifier = hab_hungarian_province
		}
		if = {
			limit = {
				has_province_modifier = hab_west_slavic_province
			}
			remove_province_modifier = hab_west_slavic_province
		}
		if = {
			limit = {
				has_province_modifier = hab_minority_province
			}
			remove_province_modifier = hab_minority_province
		}
	}

	penalties = {
		global_autonomy = 0.05
		global_tax_modifier = -0.1
	}
	ai_will_do = {
		factor = 5
	}
}

estate_nobles_hab_von_raab_restructions = {
	icon = privilege_grant_autonomy
	max_absolutism = 5
	loyalty = -0.1
	influence = -0.05
	is_valid = {
		has_country_flag = hab_von_raab_restrictions_flag
	}
	can_select = {
	}
	on_granted = {
		custom_tooltip = VON_RAAB_RESTRICTIONS_TOOLTIP
	}
	loyalty_scaled_conditional_modifier = {
		trigger = {
			NOT = {
				estate_influence = {
					estate = estate_nobles
					influence = 40
				}
			}
		}
		modifier = {
			development_cost = -0.075
		}
	}
	ai_will_do = {
		factor = 5
	}
}

estate_nobles_TIM_soyurghal_grants = {
	icon = privilege_grant_autonomy
	max_absolutism = -5
	conditional_modifier = { trigger = { has_absolutism_reduction_for_estate_privileges = yes } modifier = { max_absolutism = 1 } }
	influence = 0.1
	loyalty = 0.05
	is_valid = {
		OR = {
			tag = TIM
			was_tag = TIM
		}
		NOT = { has_country_flag = estate_nobles_TIM_soyurghal_grants_revoked }
	}
	penalties = {
		global_tax_modifier = -0.1
		reform_progress_growth = -0.1
	}
	benefits = {
		army_tradition_decay = -0.01
	}
	can_revoke = {
		custom_trigger_tooltip = {
			tooltip = BYZ_revokable_via_decision
			always = no
		}
	}
	ai_will_do = {
		factor = 0
	}
}

estate_nobles_TIM_chagatai_warriors = {
	icon = privilege_timurid_helmet
	max_absolutism = -10
	conditional_modifier = { trigger = { has_absolutism_reduction_for_estate_privileges = yes } modifier = { max_absolutism = 2 } }
	influence = 0.15
	loyalty = 0.05
	is_valid = {
		has_country_flag = TIM_unlock_privilege_about_chagatai_flag
	}
	benefits = {
		cavalry_power = 0.05
		cav_to_inf_ratio = 0.25
	}
	influence_scaled_conditional_modifier = {
		trigger = {
			always = yes
		}
		modifier = {
			army_tradition = 0.5
		}
	}
	ai_will_do = {
		factor = 1
	}
}

estate_nobles_TIM_appease_the_elites = {
	icon = privilege_army_tradition
	max_absolutism = -10
	conditional_modifier = { trigger = { has_absolutism_reduction_for_estate_privileges = yes } modifier = { max_absolutism = 2 } }
	influence = 0.15
	loyalty = 0.05
	is_valid = {
		has_country_flag = TIM_unlock_appease_the_elites_privilege_flag
	}
	penalties = {
		land_forcelimit_modifier = -0.1
	}
	
	influence_scaled_conditional_modifier = {
		trigger = {
			has_dlc = "Cradle of Civilization"
			NOT = { 
				estate_influence = {
					estate = estate_nobles
					influence = 100
				}
			}
		}
		modifier = {
			yearly_army_professionalism = 0.01
		}
	}
	
	influence_scaled_conditional_modifier = {
		trigger = {
			NOT = { has_dlc = "Cradle of Civilization" }
			NOT = { 
				estate_influence = {
					estate = estate_nobles
					influence = 100
				}
			}
		}
		modifier = {
			army_tradition = 1
		}
	}
	
	conditional_modifier = {
		trigger = {
			NOT = { has_dlc = "Cradle of Civilization" }
			estate_influence = {
				estate = estate_nobles
				influence = 100
			}
		}
		modifier = {
			army_tradition = 1
		}
	}
	
	conditional_modifier = {
		trigger = {
			has_dlc = "Cradle of Civilization"
			estate_influence = {
				estate = estate_nobles
				influence = 100
			}
		}
		modifier = {
			yearly_army_professionalism = 0.01
		}
	}
	
	on_granted = {
		custom_tooltip = scaling_with_estate_influence_tt
		tooltip = {
			if = {
				limit = {
					has_dlc = "Cradle of Civilization"
				}
				add_country_modifier = {
					name = TIM_full_army_prof
					duration = -1
					desc = UNTIL_REVOKED
				}
			}
			else = {
				add_country_modifier = {
					name = TIM_full_army_trad
					duration = -1
					desc = UNTIL_REVOKED
				}
			}
		}
	}
	ai_will_do = {
		factor = 0 
	}
}

estate_nobles_MUG_development_of_the_subah = {
	icon = privilege_states
	influence = 0.05
	max_absolutism = -5
	loyalty = 0
	is_valid = {
		has_country_flag = MUG_unlock_privilege_subahs_flag
	}
	
	benefits = {
		state_governing_cost = -0.15
	}
	penalties = {
		province_warscore_cost = 0.05
	}
	
	ai_will_do = {
		factor = 1 #AI will not expand quickly enough
	}
}

estate_nobles_four_class_system = {
	icon = estate_eunuchs_establish_favor_system_privilege
	max_absolutism = -10
	influence = 0.05
	loyalty = 0.05
	conditional_modifier = { trigger = { has_absolutism_reduction_for_estate_privileges = yes } modifier = { max_absolutism = 2 } }
	is_valid = {
		has_country_flag = yua_four_class_system_flag
	}
	loyalty_scaled_conditional_modifier = {
		trigger = { always = yes }
		modifier = {
			advisor_cost = -0.15
		}
	}
	
	loyalty_scaled_conditional_modifier = {
		trigger = { is_emperor_of_china = yes }
		modifier = {
			imperial_mandate = 0.05
		}
	}
	
	loyalty_scaled_conditional_modifier = {
		trigger = { is_emperor_of_china = no }
		modifier = {
			global_autonomy = -0.05
		}
	}
	
	ai_will_do = {
		factor = 1
	}
}

estate_nobles_hungarian_nobility_privileges = {
	icon = privilege_grant_autonomy
	max_absolutism = -15
	conditional_modifier = { trigger = { has_absolutism_reduction_for_estate_privileges = yes } modifier = { max_absolutism = 3 } }
	loyalty = 0.05
	influence = 0.1
	is_valid = {
		has_dlc = "Winds of Change"
		OR = {
			current_age = age_of_absolutism
			current_age = age_of_revolutions
		}
		NOT = { has_country_flag = hun_no_more_hungarian_privileges_flag }
		NOT = { exists = HUN }
		OR = {
			tag = HAB
			AND = {
				was_tag = HAB
				tag = AUH
			}
		}
		num_of_owned_provinces_with = {
			value = 5
			OR = {
				culture = hungarian
				is_core = HUN
			}
		}
	}
	on_granted = {
		custom_tooltip = HAB_ALL_HUNGARIAN_PROVINCES_GAIN_THE_FOLLOWING
		tooltip = {
			add_province_modifier = {
				name = hab_hungarian_privileges
				duration = -1
			}
		}
	}
	on_granted_province = {
		if = {
			limit = {
				OR = {
					culture = hungarian
					is_core = HUN
				}
			}
			add_province_modifier = {
				name = hab_hungarian_privileges
				duration = -1
			}
		}
	}

	on_revoked_province = {
		if = {
			limit = {
				has_province_modifier = hab_hungarian_privileges
			}
			remove_province_modifier = hab_hungarian_privileges
		}
	}
	
	can_revoke = {
		NOT = { tag = AUH }
	}
	cooldown_years = 25
	ai_will_do = {
		factor = 1
	}
}

estate_nobles_austrian_nobility_privileges = {
	icon = privilege_grant_autonomy
	max_absolutism = -15
	conditional_modifier = { trigger = { has_absolutism_reduction_for_estate_privileges = yes } modifier = { max_absolutism = 3 } }
	loyalty = 0.05
	influence = 0.1
	is_valid = {
		has_dlc = "Winds of Change"
		OR = {
			current_age = age_of_absolutism
			current_age = age_of_revolutions
		}
		NOT = { has_country_flag = hun_no_more_austrian_privileges_flag }
		NOT = { exists = HAB }
		OR = {
			tag = HUN
			AND = {
				was_tag = HUN
				tag = AUH
			}
		}
		num_of_owned_provinces_with = {
			value = 5
			OR = {
				culture = austrian
				is_core = HAB
			}
		}
	}
	on_granted = {
		custom_tooltip = HUN_ALL_AUSTRIAN_PROVINCES_GAIN_THE_FOLLOWING
		tooltip = {
			add_province_modifier = {
				name = hun_austrian_privileges
				duration = -1
			}
		}
	}
	on_granted_province = {
		if = {
			limit = {
				OR = {
					culture = austrian
					is_core = HAB
				}
			}
			add_province_modifier = {
				name = hun_austrian_privileges
				duration = -1
			}
		}
	}

	on_revoked_province = {
		if = {
			limit = {
				has_province_modifier = hun_austrian_privileges
			}
			remove_province_modifier = hun_austrian_privileges
		}
	}
	
	can_revoke = {
		NOT = { tag = AUH }
	}
	cooldown_years = 25
	ai_will_do = {
		factor = 1
	}
}