﻿japanese_governor = {
	allow_children = no

	default_candidates = { holder_close_family landed_vassal holder_councilor holder_court_position }

	candidate_score = {
		value = {
			# Base - Based on skills
			add = {
				value = martial
				add = diplomacy
				add = stewardship
				add = intrigue
				add = learning
				multiply = 1
				desc = sum_of_skills_desc
			}
			# TRAITS
			if = {
				limit = { has_trait = governor }
				add = {
					value = 5
					if = {
						limit = {
							has_trait_xp = { trait = governor value >= 25 }
						}
						add = 5
					}
					if = {
						limit = {
							has_trait_xp = { trait = governor value >= 50 }
						}
						add = 5
					}
					if = {
						limit = {
							has_trait_xp = { trait = governor value >= 75 }
						}
						add = 5
					}
					desc = governor_trait_desc_short
				}
			}
			if = {
				limit = {
					OR = {
						has_trait = blind
						has_trait = incapable
						has_trait = infirm
					}
				}
				subtract = {
					value = 50
					desc = negative_trait_succession
				}
			}
			if = {
				limit = { has_trait = disinherited }
				subtract = {
					value = 200
					desc = trait_disinherited
				}
			}
			if = {
				limit = { has_trait = gallivanter }
				subtract = {
					value = 200
					desc = trait_gallivanter
				}
			}
			if = {
				limit = { has_trait = devoted }
				subtract = {
					value = 250
					desc = trait_devoted
				}
			}
			else_if = {
				limit = { is_clergy = yes }
				subtract = {
					value = 250
					desc = IS_CLERGY_TRIGGER
				}
			}
			# CRIMINAL
			if = {
				limit = {
					has_trait = deviant
					exists = top_liege.primary_title.state_faith
					trait_is_criminal_in_faith_trigger = { TRAIT = deviant FAITH = top_liege.primary_title.state_faith GENDER_CHARACTER = root }
				}
				add = {
					value = -30
					desc = "deviant_and_criminal_desc"
				}
			}
			if = {
				limit = {
					has_trait = incestuous
					exists = top_liege.primary_title.state_faith
					trait_is_criminal_in_faith_trigger = { TRAIT = incestuous FAITH = top_liege.primary_title.state_faith GENDER_CHARACTER = root }
				}
				add = {
					value = -30
					desc = "incestuous_and_criminal_desc"
				}
			}
			if = {
				limit = {
					has_trait = sodomite
					exists = top_liege.primary_title.state_faith
					trait_is_criminal_in_faith_trigger = { TRAIT = sodomite FAITH = top_liege.primary_title.state_faith GENDER_CHARACTER = root }
				}
				add = {
					value = -30
					desc = "sodomite_and_criminal_desc"
				}
			}
			if = {
				limit = {
					has_trait = cannibal
					exists = top_liege.primary_title.state_faith
					trait_is_criminal_in_faith_trigger = { TRAIT = cannibal FAITH = top_liege.primary_title.state_faith GENDER_CHARACTER = root }
				}
				add = {
					value = -30
					desc = "cannibal_and_criminal_desc"
				}
			}
			if = {
				limit = {
					has_trait = kinslayer_1
					exists = top_liege.primary_title.state_faith
					trait_is_criminal_in_faith_trigger = { TRAIT = kinslayer_1 FAITH = top_liege.primary_title.state_faith GENDER_CHARACTER = root }
				}
				add = {
					value = -30
					desc = "kinslayer_1_and_criminal_desc"
				}
			}
			if = {
				limit = {
					has_trait = kinslayer_2
					exists = top_liege.primary_title.state_faith
					trait_is_criminal_in_faith_trigger = { TRAIT = kinslayer_2 FAITH = top_liege.primary_title.state_faith GENDER_CHARACTER = root }
				}
				add = {
					value = -30
					desc = "kinslayer_2_and_criminal_desc"
				}
			}
			if = {
				limit = {
					has_trait = kinslayer_3
					exists = top_liege.primary_title.state_faith
					trait_is_criminal_in_faith_trigger = { TRAIT = kinslayer_3 FAITH = top_liege.primary_title.state_faith GENDER_CHARACTER = root }
				}
				add = {
					value = -30
					desc = "kinslayer_3_and_criminal_desc"
				}
			}
			if = {
				limit = {
					has_trait = witch
					exists = top_liege.primary_title.state_faith
					trait_is_criminal_in_faith_trigger = { TRAIT = witch FAITH = top_liege.primary_title.state_faith GENDER_CHARACTER = root }
				}
				add = {
					value = -30
					desc = "witch_and_criminal_desc"
				}
			}
			if = {
				limit = {
					has_trait = adulterer
					exists = top_liege.primary_title.state_faith
					trait_is_criminal_in_faith_trigger = { TRAIT = adulterer FAITH = top_liege.primary_title.state_faith GENDER_CHARACTER = root }
				}
				add = {
					value = -30
					desc = "adulterer_and_criminal_desc"
				}
			}
			if = {
				limit = {
					has_trait = fornicator
					exists = top_liege.primary_title.state_faith
					trait_is_criminal_in_faith_trigger = { TRAIT = fornicator FAITH = top_liege.primary_title.state_faith GENDER_CHARACTER = root }
				}
				add = {
					value = -30
					desc = "fornicator_and_criminal_desc"
				}
			}
			# COUNCIL POSITIONS
			if = {
				limit = {
					scope:title.holder ?= {
						any_councillor ?= { this = root }
					}
				}
				add = {
					value = 20
					multiply = scope:title.holder.governor_efficiency
					desc = councillor_position_governor_desc
				}
			}
			# COURT POSITIONS
			if = {
				limit = {
					scope:title.holder ?= {
						any_court_position_holder ?= {
							this = root
						}
					}
				}
				add = {
					value = 5
					multiply = scope:title.holder.governor_efficiency
					desc = court_position_succession_governor_desc
				}
			}
			# FAITH HOSTILITY
			if = {
				limit = {
					scope:title.holder.primary_title.state_faith ?= {
						faith_hostility_level = {
							target = root.faith
							value = faith_astray_level
						}
					}
				} #Change to faith acceptance
				subtract = {
					value = 10
					desc = astray_faith_succession_desc
				}
			}
			if = {
				limit = {
					scope:title.holder.primary_title.state_faith ?= {
						faith_hostility_level = {
							target = root.faith
							value = faith_hostile_level
						}
					}
				} #Change to faith acceptance
				subtract = {
					value = 25
					desc = hostile_faith_succession_desc
				}
			}
			if = {
				limit = {
					scope:title.holder.primary_title.state_faith ?= {
						faith_hostility_level = {
							target = root.faith
							value >= faith_evil_level
						}
					}
				} #Change to faith acceptance
				subtract = {
					value = 50
					desc = evil_faith_sucession_desc
				}
			}
			# CLAIMS
			if = {
				limit = { has_strong_claim_on = scope:title }
				add = {
					value = 25
					desc = title_claim_desc
				}
			}
			else_if = {
				limit = { has_weak_claim_on = scope:title }
				add = {
					value = 15
					desc = title_weak_claim_desc
				}
			}
			# POPULAR OPINION
			if = {
				limit = { is_landed = yes }
				add = {
					value = {
						value = capital_county.county_holder_opinion
						multiply = 0.25
					}
					desc = county_holder_opinion_desc
				}
			}
			# PERKS
			if = {
				limit = { has_perk = ducal_conquest_perk }
				add = {
					value = 30
					desc = ducal_conquest_perk_name
				}
			}
			# LOWBORN? EW no
			if = {
				limit = { is_lowborn = yes }
				subtract = {
					value = 25
					desc = lowborn_desc_succession
				}
			}
			# INFLUENCE LEVEL
			if = {
				limit = { influence_level = 0 }
				subtract = {
					value = 10
					desc = "[influence_level|E]"
				}
			}
			if = {
				limit = { influence_level >= 2 }
				add = {
					value = 10
					multiply = {
						value = influence_level
						subtract = 1 # Base value should start at 2
					}
					desc = "[influence_level|E]"
				}
			}
			#SAME CULTURE AS REGION
			if = {
				limit = { culture ?= scope:title.holder.capital_county.culture }
				add = {
					value = 10
					desc = of_local_culture_succession_desc
				}
			}
			# PERSONAL REASONS
			if = {
				limit = {
					scope:title.holder ?= { is_close_family_of = root }
				}
				add = {
					value = 10
					multiply = scope:title.holder.governor_efficiency
					desc = "close_family_holder_desc"
				}
			}
			else_if = {
				limit = {
					scope:title.holder ?= {
						any_spouse = { is_close_family_of = root }
						NOT = { is_close_family_of = root }
					}
				}
				add = {
					value = 10
					desc = "close_family_married_to_holder_desc"
				}
			}
			#FRIENDS OF THE HOLDER
			if = {
				limit = {
					scope:title.holder ?= { has_relation_friend = root }
				}
				add = {
					value = 5
					multiply = scope:title.holder.governor_efficiency
					desc = governor_friend_desc
				}
			}
			if = {
				limit = {
					scope:title.holder ?= { has_relation_best_friend = root }
				}
				add = {
					value = 15
					multiply = scope:title.holder.governor_efficiency
					desc = governor_best_friend_desc
				}
			}
			#REGENT OF KAMPAKU
			if = {
				limit = { scope:title.holder.diarch ?= root }
				add = {
					value = scope:title.holder.diarchy_swing
					desc = governor_diarch_desc
				}
			}
			# PETITION
			if = {
				limit = {
					exists = house.var:petition_liege_appointment_support
					top_liege.primary_title.var:administrative_ui_special_title.holder ?= house.var:petition_liege_appointment_support
					NOT = { scope:title = top_liege.primary_title } # Only governorships
				}
				multiply = {
					value = 1.15
					desc = ceremonial_liege_appointment_support_desc
				}
			}
			# SCHEMES
			if = {
				limit = { has_character_modifier = scheme_slandered_modifier }
				add = {
					value = slander_appointment_score_value
					desc = scheme_slandered_modifier
				}
			}
			if = {
				limit = { has_character_modifier = scheme_promoted_modifier }
				add = {
					value = promote_appointment_score_value	# Keep this balanced if more values are added!
					desc = scheme_promoted_modifier
				}
			}
			# DECISIONS
			if = {
				limit = {
					has_character_modifier = ep3_integration_promoter_modifier
					has_variable = integration_promoted_in
					var:integration_promoted_in.duchy ?= scope:title
				}
				add = {
					value = 30
					desc = ep3_integration_promoter_modifier
				}
			}
			# PETITION
			if = {
				limit = { scope:title.var:petition_house_rights ?= house }
				add = {
					value = 250
					desc = petition_liege_house_province_rights_value_desc
				}
			}
			# CEREMONIAL LIEGE
			if = {
				limit = {
					tgp_is_ceremonial_liege_trigger = yes
					NOT = { scope:title = top_liege.primary_title }
				}
				add = {
					value = -1000
					desc = ceremonial_liege_desc
				}
			}
			# PERKS
			if = {
				limit = { has_title = title:e_japan }
				add = {
					value = -1000
					desc = is_kampaku_tt
				}
			}
			# Age
			if = {
				limit = { age < 50 }
				add = {
					value = 50
					subtract = age
					multiply = -2
					desc = japanese_kampaku_age_desc
				}
			}
			else = {
				add = {
					value = age
					subtract = 50
					multiply = 2
					desc = japanese_kampaku_age_desc
				}
			}
			# CLIMBING TOO EARLY - AT END
			if = {
				limit = {
					trigger_if = {
						limit = { is_governor = yes }
						scope:title.tier > main_administrative_tier
						trigger_if = {
							limit = { scope:title.tier = tier_county }
							always = no
						}
						trigger_if = {
							limit = { scope:title.tier = tier_duchy }
							highest_held_title_tier <= tier_barony
						}
						trigger_else_if = {
							limit = { scope:title.tier = tier_kingdom }
							highest_held_title_tier <= tier_county
						}
						trigger_else_if = {
							limit = { scope:title.tier = tier_empire }
							highest_held_title_tier <= tier_duchy
						}
						trigger_else = {
							limit = { scope:title.tier = tier_hegemony }
							highest_held_title_tier <= tier_kingdom
						}
					}
					trigger_else = { scope:title.tier > scope:title.holder.main_administrative_tier }
				}
				multiply = {
					value = 0.5
					desc = should_hold_a_lower_tier_governorship_first
				}
			}
			# HOUSE BLOC
			if = {
				limit = {
					confederation ?= { has_cohesion_level_parameter = any_member_house_governor_appointment_score }
				}
				multiply = 1.1
			}
			if = {
				limit = {
					exists = scope:title.holder.confederation
					confederation ?= {
						this = scope:title.holder.confederation
						has_cohesion_level_parameter = any_member_house_continued_appointment_score
					}
				}
				multiply = 1.1
			}
			#ADJUST BASED ON GENDER LAW - MUST GO BEFORE EXCLUSIONS
			if = {
				limit = {
					scope:title.holder ?= { has_realm_law = male_preference_law }
					is_female = yes
				}
				multiply = {
					value = 0.25
					desc = male_preference_law
				}
			}
			else_if = {
				limit = {
					scope:title.holder ?= { has_realm_law = male_only_law }
					is_female = yes
				}
				multiply = {
					value = 0
					desc = male_only_law
				}
			}
			else_if = {
				limit = {
					scope:title.holder ?= { has_realm_law = female_preference_law }
					is_female = no
				}
				multiply = {
					value = 0.25
					desc = female_preference_law
				}
			}
			else_if = {
				limit = {
					scope:title.holder ?= { has_realm_law = female_only_law }
					is_female = no
				}
				multiply = {
					value = 0
					desc = female_only_law
				}
			}
			### TOTAL EXCLUSIONS - MUST GO AT END
			# Already a governor
			if = {
				limit = {
					is_governor = yes
					scope:title.tier = highest_held_title_tier
				}
				multiply = {
					value = 0
					desc = already_a_governor_tt
				}
			}
			# Ceremonial Liege
			if = {
				limit = {
					tgp_is_ceremonial_liege_trigger = yes
					NOT = { scope:title = top_liege.primary_title }
				}
				multiply = {
					value = 0
					desc = ceremonial_liege_desc
				}
			}
			# Top liege (emperor/kampaku)
			if = {
				limit = { is_independent_ruler = yes }
				multiply = {
					value = 0
					desc = appointment_is_top_liege
				}
			}
		}
	}
}

japanese_military_governor = {
	allow_children = no

	default_candidates = { holder_close_family landed_vassal holder_councilor holder_court_position }

	candidate_score = {
		value = {
			# Martial skill - We use this as the base for the overall score
			add = {
				value = martial
				multiply = 2
				desc = "[martial_skill|E]"
			}
			# Martial education provides additional score
			if = {
				limit = { has_trait = education_martial }
				if = {
					limit = { has_trait = education_martial_1 }
					add = {
						value = 20
						desc = has_trait_education_martial_1
					}
				}
				else_if = {
					limit = { has_trait = education_martial_2 }
					add = {
						value = 40
						desc = has_trait_education_martial_2
					}
				}
				else_if = {
					limit = { has_trait = education_martial_3 }
					add = {
						value = 60
						desc = has_trait_education_martial_3
					}
				}
				else_if = {
					limit = { has_trait = education_martial_4 }
					add = {
						value = 80
						desc = has_trait_education_martial_4
					}
				}
				else = {
					add = {
						value = 100
						desc = has_trait_education_martial_5
					}
				}
			}
			# Commander traits
			add = {
				value = number_of_commander_traits
				multiply = 20
				desc = number_of_commander_traits_desc
			}
			# Prowess
			add = {
				value = prowess
				desc = prowess_concept
			}
			# Warfare Legacy
			add = {
				value = 10
				multiply = dynasty.warfare_legacy_track_perks
				desc = has_warfare_legacy_track_desc
			}
			# Prestige
			if = {
				limit = { prestige_level != 1 }
				add = {
					value = 10
					multiply = {
						value = prestige_level
						subtract = 1 # Baseline is at 1, so we want the bonus to start at 2
					}
					desc = PRESTIGE_LEVEL_CONCEPT
				}
			}
			# Traits
			if = {
				limit = { has_trait = governor }
				add = {
					value = 5
					if = {
						limit = {
							has_trait_xp = { trait = governor value >= 25 }
						}
						add = 5
					}
					if = {
						limit = {
							has_trait_xp = { trait = governor value >= 50 }
						}
						add = 5
					}
					if = {
						limit = {
							has_trait_xp = { trait = governor value >= 75 }
						}
						add = 5
					}
					desc = governor_trait_desc_short
				}
			}
			if = {
				limit = { has_trait = disinherited }
				subtract = {
					value = 200
					desc = trait_disinherited
				}
			}
			if = {
				limit = { has_trait = gallivanter }
				subtract = {
					value = 200
					desc = trait_gallivanter
				}
			}
			if = {
				limit = { has_trait = devoted }
				subtract = {
					value = 250
					desc = trait_devoted
				}
			}
			else_if = {
				limit = { is_clergy = yes }
				subtract = {
					value = 250
					desc = IS_CLERGY_TRIGGER
				}
			}
			# CRIMINAL
			if = {
				limit = {
					has_trait = deviant
					exists = top_liege.primary_title.state_faith
					trait_is_criminal_in_faith_trigger = { TRAIT = deviant FAITH = top_liege.primary_title.state_faith GENDER_CHARACTER = root }
				}
				add = {
					value = -30
					desc = "deviant_and_criminal_desc"
				}
			}
			if = {
				limit = {
					has_trait = incestuous
					exists = top_liege.primary_title.state_faith
					trait_is_criminal_in_faith_trigger = { TRAIT = incestuous FAITH = top_liege.primary_title.state_faith GENDER_CHARACTER = root }
				}
				add = {
					value = -30
					desc = "incestuous_and_criminal_desc"
				}
			}
			if = {
				limit = {
					has_trait = sodomite
					exists = top_liege.primary_title.state_faith
					trait_is_criminal_in_faith_trigger = { TRAIT = sodomite FAITH = top_liege.primary_title.state_faith GENDER_CHARACTER = root }
				}
				add = {
					value = -30
					desc = "sodomite_and_criminal_desc"
				}
			}
			if = {
				limit = {
					has_trait = cannibal
					exists = top_liege.primary_title.state_faith
					trait_is_criminal_in_faith_trigger = { TRAIT = cannibal FAITH = top_liege.primary_title.state_faith GENDER_CHARACTER = root }
				}
				add = {
					value = -30
					desc = "cannibal_and_criminal_desc"
				}
			}
			if = {
				limit = {
					has_trait = kinslayer_1
					exists = top_liege.primary_title.state_faith
					trait_is_criminal_in_faith_trigger = { TRAIT = kinslayer_1 FAITH = top_liege.primary_title.state_faith GENDER_CHARACTER = root }
				}
				add = {
					value = -30
					desc = "kinslayer_1_and_criminal_desc"
				}
			}
			if = {
				limit = {
					has_trait = kinslayer_2
					exists = top_liege.primary_title.state_faith
					trait_is_criminal_in_faith_trigger = { TRAIT = kinslayer_2 FAITH = top_liege.primary_title.state_faith GENDER_CHARACTER = root }
				}
				add = {
					value = -30
					desc = "kinslayer_2_and_criminal_desc"
				}
			}
			if = {
				limit = {
					has_trait = kinslayer_3
					exists = top_liege.primary_title.state_faith
					trait_is_criminal_in_faith_trigger = { TRAIT = kinslayer_3 FAITH = top_liege.primary_title.state_faith GENDER_CHARACTER = root }
				}
				add = {
					value = -30
					desc = "kinslayer_3_and_criminal_desc"
				}
			}
			if = {
				limit = {
					has_trait = witch
					exists = top_liege.primary_title.state_faith
					trait_is_criminal_in_faith_trigger = { TRAIT = witch FAITH = top_liege.primary_title.state_faith GENDER_CHARACTER = root }
				}
				add = {
					value = -30
					desc = "witch_and_criminal_desc"
				}
			}
			if = {
				limit = {
					has_trait = adulterer
					exists = top_liege.primary_title.state_faith
					trait_is_criminal_in_faith_trigger = { TRAIT = adulterer FAITH = top_liege.primary_title.state_faith GENDER_CHARACTER = root }
				}
				add = {
					value = -30
					desc = "adulterer_and_criminal_desc"
				}
			}
			if = {
				limit = {
					has_trait = fornicator
					exists = top_liege.primary_title.state_faith
					trait_is_criminal_in_faith_trigger = { TRAIT = fornicator FAITH = top_liege.primary_title.state_faith GENDER_CHARACTER = root }
				}
				add = {
					value = -30
					desc = "fornicator_and_criminal_desc"
				}
			}
			# COUNCIL POSITIONS
			if = { # Is the marshal of current holder
				limit = { scope:title.holder.cp:councillor_marshal ?= root }
				add = {
					value = 20
					desc = marshal_governor_desc
				}
			}
			# COURT POSITIONS
			if = { # Has a court position with current holder
				limit = {
					scope:title.holder ?= {
						any_court_position_holder ?= { this = root }
					}
				}
				add = {
					value = 5
					desc = court_position_succession_governor_desc
				}
			}
			# FAITH HOSTILITY
			if = {
				limit = {
					scope:title.holder.primary_title.state_faith ?= {
						faith_hostility_level = {
							target = root.faith
							value = faith_astray_level
						}
					}
				} #Change to faith acceptance
				subtract = {
					value = 10
					desc = astray_faith_succession_desc
				}
			}
			if = {
				limit = {
					scope:title.holder.primary_title.state_faith ?= {
						faith_hostility_level = {
							target = root.faith
							value = faith_hostile_level
						}
					}
				} #Change to faith acceptance
				subtract = {
					value = 20
					desc = hostile_faith_succession_desc
				}
			}
			if = {
				limit = {
					scope:title.holder.primary_title.state_faith ?= {
						faith_hostility_level = {
							target = root.faith
							value >= faith_evil_level
						}
					}
				} #Change to faith acceptance
				subtract = {
					value = 30
					desc = evil_faith_sucession_desc
				}
			}
			# PERKS
			if = {
				limit = { has_perk = ducal_conquest_perk }
				add = {
					value = 30
					desc = ducal_conquest_perk_name_desc
				}
			}
			# LOWBORN? EW no
			if = {
				limit = { is_lowborn = yes }
				subtract = {
					value = 25
					desc = lowborn_desc_succession
				}
			}
			# RELATIONS
			if = { # Is child of holder
				limit = {
					scope:title.holder ?= { is_parent_of = root }
				}
				add = {
					value = 30
					desc = "parent_holder_desc"
				}
			}
			else_if = { # Is family of holder
				limit = {
					scope:title.holder ?= { is_close_family_of = root }
				}
				add = {
					value = 20
					desc = "close_family_holder_desc"
				}
			}
			else_if = { # Is family of holder's spouse
				limit = {
					scope:title.holder ?= {
						any_spouse = { is_close_family_of = root }
						NOT = { is_close_family_of = root }
					}
				}
				add = {
					value = 10
					desc = "close_family_married_to_holder_desc"
				}
			}
			if = { # Is a friend
				limit = {
					scope:title.holder ?= { has_relation_friend = root }
				}
				add = {
					value = 15
					desc = governor_friend_desc
				}
			}
			# REGENT OF EMPEROR
			if = {
				limit = { scope:title.holder.diarch ?= root }
				add = {
					value = scope:title.holder.diarchy_swing
					desc = governor_diarch_desc
				}
			}
			# PETITION
			if = {
				limit = {
					exists = house.var:petition_liege_appointment_support
					top_liege.primary_title.var:administrative_ui_special_title.holder ?= house.var:petition_liege_appointment_support
					NOT = { scope:title = top_liege.primary_title } # Only governorships
				}
				multiply = {
					value = 1.15
					desc = ceremonial_liege_appointment_support_desc
				}
			}
			# Schemes
			if = {
				limit = { has_character_modifier = scheme_slandered_modifier }
				add = {
					value = slander_appointment_score_value
					desc = scheme_slandered_modifier
				}
			}
			if = {
				limit = { has_character_modifier = scheme_promoted_modifier }
				add = {
					value = promote_appointment_score_value	# Keep this balanced if more values are added!
					desc = scheme_promoted_modifier
				}
			}
			# Decisions
			if = {
				limit = {
					has_character_modifier = ep3_integration_promoter_modifier
					has_variable = integration_promoted_in
					var:integration_promoted_in.duchy ?= scope:title
				}
				add = {
					value = 30
					desc = ep3_integration_promoter_modifier
				}
			}
			# PETITION
			if = {
				limit = { scope:title.var:petition_house_rights ?= house }
				add = {
					value = 250
					desc = petition_liege_house_province_rights_value_desc
				}
			}
			# CLIMBING TOO EARLY - AT END
			if = {
				limit = {
					trigger_if = {
						limit = { is_governor = yes }
						scope:title.tier > main_administrative_tier
						trigger_if = {
							limit = { scope:title.tier = tier_county }
							always = no
						}
						trigger_if = {
							limit = { scope:title.tier = tier_duchy }
							highest_held_title_tier <= tier_barony
						}
						trigger_else_if = {
							limit = { scope:title.tier = tier_kingdom }
							highest_held_title_tier <= tier_county
						}
						trigger_else_if = {
							limit = { scope:title.tier = tier_empire }
							highest_held_title_tier <= tier_duchy
						}
						trigger_else = {
							limit = { scope:title.tier = tier_hegemony }
							highest_held_title_tier <= tier_kingdom
						}
					}
					trigger_else = { scope:title.tier > scope:title.holder.main_administrative_tier }
				}
				multiply = {
					value = 0.5
					desc = should_hold_a_lower_tier_governorship_first
				}
			}
			#ADJUST BASED ON GENDER LAW - MUST GO BEFORE EXCLUSIONS
			if = {
				limit = {
					scope:title.holder ?= { has_realm_law = male_preference_law }
					is_female = yes
				}
				multiply = {
					value = 0.25
					desc = male_preference_law
				}
			}
			else_if = {
				limit = {
					scope:title.holder ?= { has_realm_law = male_only_law }
					is_female = yes
				}
				multiply = {
					value = 0
					desc = male_only_law
				}
			}
			else_if = {
				limit = {
					scope:title.holder ?= { has_realm_law = female_preference_law }
					is_female = no
				}
				multiply = {
					value = 0.25
					desc = female_preference_law
				}
			}
			else_if = {
				limit = {
					scope:title.holder ?= { has_realm_law = female_only_law }
					is_female = no
				}
				multiply = {
					value = 0
					desc = female_only_law
				}
			}
			### TOTAL EXCLUSIONS - MUST GO AT END
			# Already a governor
			if = {
				limit = {
					is_governor = yes
					scope:title.tier = highest_held_title_tier
				}
				multiply = {
					value = 0
					desc = already_a_governor_tt
				}
			}
			# Ceremonial Liege
			if = {
				limit = {
					tgp_is_ceremonial_liege_trigger = yes
					NOT = { scope:title = top_liege.primary_title }
				}
				multiply = {
					value = 0
					desc = ceremonial_liege_desc
				}
			}
			# Top liege (emperor/kampaku)
			if = {
				limit = { is_independent_ruler = yes }
				multiply = {
					value = 0
					desc = appointment_is_top_liege
				}
			}
		}
	}
}
