remove_state_economy_modifier = {
	hidden_effect = {
		remove_modifier = dev_0_country
		remove_modifier = dev_1_country
		remove_modifier = dev_2_country
		remove_modifier = dev_3_country
		remove_modifier = dev_4_country
		remove_modifier = dev_5_country
		remove_modifier = dev_6_country
		remove_modifier = dev_7_country
		remove_modifier = dev_8_country
	}
}

remove_state_demographic_modifier = {
	hidden_effect = {
		remove_modifier = demographic_stage_0
		remove_modifier = demographic_stage_1
		remove_modifier = demographic_stage_2
		remove_modifier = demographic_stage_3
		remove_modifier = demographic_stage_4
		remove_modifier = demographic_stage_5
		remove_modifier = demographic_stage_6
		remove_modifier = demographic_stage_7
		remove_modifier = demographic_stage_8
	}
}

# State Finder Script
ztr_state_finder_script = {
	ordered_scope_state = {
		limit = {
			NOT = {
				is_homeland_of_country_cultures = root
			}
			state_region = {
				is_homeland = scope:ztr_minor_primary_culture
			}
		}
		order_by = gdp
		save_scope_as = ztr_state_finder
	}
}

# State Finder Script
ztr_second_state_finder_script = {
	ordered_scope_state = {
		limit = {
			NOT = {
				is_homeland_of_country_cultures = root
			}
			state_region = {
				OR = {
					is_homeland = scope:ztr_minor_primary_culture
					is_homeland = scope:ztr_second_minor_primary_culture
				}
			}
		}
		order_by = gdp
		save_scope_as = ztr_state_finder
	}
}

# Gdp dependent cost (define first, then use)
define_ztr_gdp_dependent_cost = {
	set_variable = {
		name = ztr_gdp_dependent_cost
		value = gdp
	}
	change_variable = {
		name = ztr_gdp_dependent_cost
		multiply = -1
	}
	change_variable = {
		name = ztr_gdp_dependent_cost
		divide = 100
	}
}
ztr_gdp_dependent_cost = {
	add_treasury = var:ztr_gdp_dependent_cost
	remove_variable = ztr_gdp_dependent_cost
}

# Gdp dependent income (define first, then use)
define_ztr_gdp_dependent_income = {
	set_variable = {
		name = ztr_gdp_dependent_income
		value = gdp
	}
	change_variable = {
		name = ztr_gdp_dependent_income
		divide = 100
	}
}
ztr_gdp_dependent_income = {
	add_treasury = var:ztr_gdp_dependent_income
	remove_variable = ztr_gdp_dependent_income
}

# Unincorporated State Finder Script
ztr_unincorporated_state_finder_script = {
	ordered_scope_state = {
		limit = {
			NOT = {
				is_homeland_of_country_cultures = root
			}
			state_region = {
				is_homeland = scope:ztr_minor_primary_culture
			}
			is_incorporated = no
		}
		order_by = gdp
		save_scope_as = ztr_unincorporated_state_finder
	}
}

# Religions Script
african_religion_setting = {
	if = {
		limit = {
			religion_percent_country = {
				target = rel:catholic
				value >= 0.5
			}
		}
		set_state_religion = rel:catholic
	}
	else_if = {
		limit = {
			religion_percent_country = {
				target = rel:protestant
				value >= 0.5
			}
		}
		set_state_religion = rel:protestant
	}
	else_if = {
		limit = {
			religion_percent_country = {
				target = rel:sunni
				value >= 0.5
			}
		}
		set_state_religion = rel:sunni
	}
	else = {
		set_state_religion = rel:sunni
	}
}

#############################
#POLITICS
#############################

# Progressist Ideology Scripts
ztr_apply_early_progressist_ideologies = {
	# BPM Ideologies
	if = {
		limit = { BPM_is_active_trigger = yes }
		ig:ig_agrarian_populists = {
			add_ideology = ideology_extreme_traditionalist
			add_ideology = ideology_moderate_ambientalist
		}
		ig:ig_anarchists = {
			add_ideology = ideology_extreme_progressist
		}
		ig:ig_christian_democrats = {
			add_ideology = ideology_extreme_traditionalist
		}
		ig:ig_conservatives = {
			add_ideology = ideology_extreme_traditionalist
			add_ideology = ideology_neg_ambientalist
		}
		ig:ig_fascists = {
			add_ideology = ideology_extreme_traditionalist
			add_ideology = ideology_neg_ambientalist
		}
		ig:ig_liberals = {
			add_ideology = ideology_moderate_progressist
			add_ideology = ideology_neg_ambientalist
		}
		ig:ig_market_liberals = {
			add_ideology = ideology_neg_ambientalist
		}
		ig:ig_national_liberals = {
			add_ideology = ideology_moderate_traditionalist
			add_ideology = ideology_neg_ambientalist
		}
		ig:ig_radicals = {
			add_ideology = ideology_moderate_progressist
			add_ideology = ideology_moderate_ambientalist
		}
		ig:ig_reactionaries = {
			add_ideology = ideology_extreme_traditionalist
		}
		ig:ig_reformist_socialists = {
			add_ideology = ideology_moderate_progressist
		}
		ig:ig_revolutionist_socialists = {
			add_ideology = ideology_moderate_progressist
			add_ideology = ideology_neg_ambientalist
		}
		ig:ig_socialists = {
			add_ideology = ideology_moderate_progressist
		}
	}
	ig:ig_landowners = {
		add_ideology = ideology_extreme_traditionalist
	}
	ig:ig_armed_forces = {
		add_ideology = ideology_extreme_traditionalist
		add_ideology = ideology_neg_ambientalist
	}
	ig:ig_devout = {
		add_ideology = ideology_extreme_traditionalist
	}
	ig:ig_industrialists = {
		add_ideology = ideology_moderate_progressist
		add_ideology = ideology_neg_ambientalist
	}
	ig:ig_intelligentsia = {
		add_ideology = ideology_moderate_progressist
		add_ideology = ideology_moderate_ambientalist
	}
	ig:ig_petty_bourgeoisie = {
		add_ideology = ideology_moderate_traditionalist
	}
	ig:ig_rural_folk = {
		add_ideology = ideology_moderate_traditionalist
	}
	ig:ig_trade_unions = {
		add_ideology = ideology_moderate_progressist
	}
}

ztr_apply_mid_progressist_ideologies = {
	# BPM Ideologies
	if = {
		limit = { BPM_is_active_trigger = yes }
		ig:ig_agrarian_populists = {
			remove_ideology = ideology_moderate_ambientalist
			add_ideology = ideology_extreme_ambientalist
		}
		ig:ig_anarchists = {
			add_ideology = ideology_moderate_ambientalist
		}
		ig:ig_christian_democrats = {
			remove_ideology = ideology_extreme_traditionalist
			add_ideology = ideology_moderate_traditionalist
		}
		ig:ig_conservatives = {
			remove_ideology = ideology_extreme_traditionalist
			add_ideology = ideology_moderate_traditionalist
			remove_ideology = ideology_neg_ambientalist
		}
		# ig:ig_fascists = {
		# }
		ig:ig_liberals = {
			remove_ideology = ideology_neg_ambientalist
			add_ideology = ideology_moderate_ambientalist
		}
		# ig:ig_market_liberals = {
		# 	add_ideology = ideology_moderate_progressist
		# 	add_ideology = ideology_neg_ambientalist
		# }
		ig:ig_national_liberals = {
			remove_ideology = ideology_moderate_traditionalist
		}
		ig:ig_radicals = {
			remove_ideology = ideology_moderate_progressist
			add_ideology = ideology_extreme_progressist
			remove_ideology = ideology_moderate_ambientalist
			add_ideology = ideology_extreme_ambientalist
		}
		# ig:ig_reactionaries = {
		# }
		ig:ig_reformist_socialists = {
			add_ideology = ideology_moderate_ambientalist
		}
		ig:ig_revolutionist_socialists = {
			remove_ideology = ideology_moderate_progressist
			add_ideology = ideology_extreme_progressist
			remove_ideology = ideology_neg_ambientalist
		}
		ig:ig_socialists = {
			remove_ideology = ideology_moderate_progressist
			add_ideology = ideology_extreme_progressist
			add_ideology = ideology_moderate_ambientalist
		}
	}
	# ig:ig_landowners = {
	# 	remove_ideology = ideology_extreme_traditionalist
	# }
	# ig:ig_armed_forces = {
	# 	remove_ideology = ideology_extreme_traditionalist
	# 	add_ideology = ideology_moderate_traditionalist
	# }
	ig:ig_devout = {
		remove_ideology = ideology_extreme_traditionalist
		add_ideology = ideology_moderate_traditionalist
		add_ideology = ideology_moderate_ambientalist
	}
	# ig:ig_industrialists = {
	# 	remove_ideology = ideology_moderate_progressist
	# }
	# ig:ig_intelligentsia = {
	# 	remove_ideology = ideology_moderate_progressist
	# }
	ig:ig_petty_bourgeoisie = {
		add_ideology = ideology_neg_ambientalist
	}
	ig:ig_rural_folk = {
		add_ideology = ideology_moderate_ambientalist
	}
	ig:ig_trade_unions = {
		remove_ideology = ideology_moderate_progressist
		add_ideology = ideology_extreme_progressist
		add_ideology = ideology_moderate_ambientalist
	}
}

ztr_apply_late_progressist_ideologies = {
	# BPM Ideologies
	if = {
		limit = { BPM_is_active_trigger = yes }
		# ig:ig_agrarian_populists = {
		# }
		ig:ig_anarchists = {
			remove_ideology = ideology_moderate_ambientalist
			add_ideology = ideology_extreme_ambientalist
		}
		ig:ig_christian_democrats = {
			add_ideology = ideology_moderate_ambientalist
		}
		ig:ig_conservatives = {
			add_ideology = ideology_moderate_ambientalist
		}
		# ig:ig_fascists = {
		# }
		ig:ig_liberals = {
			remove_ideology = ideology_moderate_progressist
			add_ideology = ideology_extreme_progressist
			remove_ideology = ideology_moderate_ambientalist
			add_ideology = ideology_neoliberal_ambientalist
			# Liberals are more progressive than market_liberals
		}
		ig:ig_market_liberals = {
			add_ideology = ideology_neoliberal_progressist
			remove_ideology = ideology_neg_ambientalist
			add_ideology = ideology_neoliberal_ambientalist
		}
		ig:ig_national_liberals = {
			remove_ideology = ideology_neg_ambientalist
			add_ideology = ideology_neoliberal_ambientalist
		}
		# ig:ig_radicals = {
		# }
		# ig:ig_reactionaries = {
		# }
		ig:ig_reformist_socialists = {
			remove_ideology = ideology_moderate_progressist
			add_ideology = ideology_neoliberal_progressist
		}
		# ig:ig_revolutionist_socialists = {
		# }
		# ig:ig_socialists = {
		# }
	}
	ig:ig_landowners = {
		remove_ideology = ideology_extreme_traditionalist
		add_ideology = ideology_neoliberal_progressist
	}
	ig:ig_armed_forces = {
		remove_ideology = ideology_extreme_traditionalist
		add_ideology = ideology_moderate_traditionalist
		remove_ideology = ideology_neg_ambientalist
	}
	# ig:ig_devout = {
	# 	remove_ideology = ideology_moderate_traditionalist
	# }
	ig:ig_industrialists = {
		remove_ideology = ideology_moderate_progressist
		add_ideology = ideology_neoliberal_progressist
		remove_ideology = ideology_neg_ambientalist
		add_ideology = ideology_neoliberal_ambientalist
	}
	ig:ig_intelligentsia = {
		remove_ideology = ideology_moderate_progressist
		add_ideology = ideology_extreme_progressist
	}
	# ig:ig_petty_bourgeoisie = {
	# 	remove_ideology = ideology_moderate_traditionalist
	# }
	ig:ig_rural_folk = {
		remove_ideology = ideology_moderate_ambientalist
		add_ideology = ideology_extreme_ambientalist
	}
	# ig:ig_trade_unions = {
	# 	remove_ideology = ideology_extreme_progressist
	# }
	every_interest_group = {
		limit = {
			has_ideology = ideology:ideology_laissez_faire
		}
		remove_ideology = ideology_laissez_faire
		add_ideology = ideology_neoliberism
	}
}



# Liberty Equality Index Triggers
calculate_liberty_equality_index = {
	# Here we give cake only if the law gives more liberty than worst case, which will always value 0
	set_variable = {
		name = liberty_index_var
		value = 0
	}
	set_variable = {
		name = equality_index_var
		value = 0
	}
	# Governance Principles
	if = {
		limit = {
			has_law_or_variant = law_type:law_parliamentary_republic
		}
		change_variable = {
			name = liberty_index_var
			add = 6
		}
		change_variable = {
			name = equality_index_var
			add = 1
		}
	}
	else_if = {
		limit = {
			OR = {
				has_law_or_variant = law_type:law_monarchy
				has_law_or_variant = law_type:law_presidential_republic
			}
		}
		change_variable = {
			name = liberty_index_var
			add = 4
		}
	}
	else_if = {
		limit = {
			has_law_or_variant = law_type:law_council_republic
		}
		change_variable = {
			name = liberty_index_var
			add = 2
		}
		change_variable = {
			name = equality_index_var
			add = 2
		}
	}
	else_if = {
		limit = {
			OR = {
				has_law_or_variant = law_type:law_theocracy
				has_law_or_variant = law_type:law_corporate_state
			}
		}
		change_variable = {
			name = liberty_index_var
			add = 1
		}
	}
	# Distribution of Power
	if = {
		limit = {
			has_law_or_variant = law_type:law_universal_suffrage
		}
		change_variable = {
			name = liberty_index_var
			add = 15
		}
		change_variable = {
			name = equality_index_var
			add = 5
		}
	}
	else_if = {
		limit = {
			has_law_or_variant = law_type:law_census_voting
		}
		change_variable = {
			name = liberty_index_var
			add = 10
		}
		change_variable = {
			name = equality_index_var
			add = 3
		}
	}
	else_if = {
		limit = {
			has_law_or_variant = law_type:law_wealth_voting
		}
		change_variable = {
			name = liberty_index_var
			add = 7
		}
		change_variable = {
			name = equality_index_var
			add = 2
		}
	}
	else_if = {
		limit = {
			has_law_or_variant = law_type:law_landed_voting
		}
		change_variable = {
			name = liberty_index_var
			add = 4
		}
		change_variable = {
			name = equality_index_var
			add = 1
		}
	}
	else_if = {
		limit = {
			has_law_or_variant = law_type:law_anarchy
		}
		change_variable = {
			name = liberty_index_var
			add = 1
		}
		change_variable = {
			name = equality_index_var
			add = 1
		}
	}
	else_if = {
		limit = {
			OR = {
				has_law_or_variant = law_type:law_technocracy
				has_law_or_variant = law_type:law_elder_council
				has_law_or_variant = law_type:law_oligarchy
			}
		}
		change_variable = {
			name = liberty_index_var
			add = 1
		}
	}
	else = {
		change_variable = {
			name = liberty_index_var
			add = -2
		}
	}
	# Religion
	if = {
		limit = {
			has_law_or_variant = law_type:law_total_separation
		}
		change_variable = {
			name = liberty_index_var
			add = 5
		}
		change_variable = {
			name = equality_index_var
			add = 2
		}
	}
	else_if = {
		limit = {
			has_law_or_variant = law_type:law_freedom_of_conscience
		}
		change_variable = {
			name = liberty_index_var
			add = 4
		}
		change_variable = {
			name = equality_index_var
			add = 1
		}
	}
	else_if = {
		limit = {
			has_law_or_variant = law_type:law_state_atheism
		}
		change_variable = {
			name = liberty_index_var
			add = 2
		}
		change_variable = {
			name = equality_index_var
			add = 1
		}
	}
	# Bureaucracy
	if = {
		limit = {
			has_law_or_variant = law_type:law_elected_bureaucrats
		}
		change_variable = {
			name = liberty_index_var
			add = 4
		}
		change_variable = {
			name = equality_index_var
			add = 1
		}
	}
	else_if = {
		limit = {
			has_law_or_variant = law_type:law_appointed_bureaucrats
		}
		change_variable = {
			name = liberty_index_var
			add = 3
		}
		change_variable = {
			name = equality_index_var
			add = 1
		}
	}
	# Internal Security
	if = {
		limit = {
			has_law_or_variant = law_type:law_guaranteed_liberties
		}
		change_variable = {
			name = liberty_index_var
			add = 6
		}
		change_variable = {
			name = equality_index_var
			add = 1
		}
	}
	else_if = {
		limit = {
			has_law_or_variant = law_type:law_no_home_affairs
		}
		change_variable = {
			name = liberty_index_var
			add = 3
		}
		change_variable = {
			name = equality_index_var
			add = 1
		}
	}
	else_if = {
		limit = {
			has_law_or_variant = law_type:law_secret_police
		}
		change_variable = {
			name = liberty_index_var
			add = 2
		}
	}
	# Economic System
	if = {
		limit = {
			has_law_or_variant = law_type:law_laissez_faire
		}
		change_variable = {
			name = liberty_index_var
			add = 3
		}
		change_variable = {
			name = equality_index_var
			add = 2
		}
	}
	else_if = {
		limit = {
			has_law_or_variant = law_type:law_interventionism
		}
		change_variable = {
			name = liberty_index_var
			add = 2
		}
		change_variable = {
			name = equality_index_var
			add = 10
		}
	}
	else_if = {
		limit = {
			OR = {
				has_law_or_variant = law_type:law_cooperative_ownership
				has_law_or_variant = law_type:law_agrarianism
			}
		}
		change_variable = {
			name = liberty_index_var
			add = 1
		}
		change_variable = {
			name = equality_index_var
			add = 8
		}
	}
	else_if = {
		limit = {
			has_law_or_variant = law_type:law_command_economy
		}
		change_variable = {
			name = equality_index_var
			add = 16
		}
	}
	# Trade Policy
	if = {
		limit = {
			has_law_or_variant = law_type:law_free_trade
		}
		change_variable = {
			name = liberty_index_var
			add = 6
		}
		change_variable = {
			name = equality_index_var
			add = 2
		}
	}
	else_if = {
		limit = {
			has_law_or_variant = law_type:law_protectionism
		}
		change_variable = {
			name = liberty_index_var
			add = 4
		}
		change_variable = {
			name = equality_index_var
			add = 2
		}
	}
	else_if = {
		limit = {
			has_law_or_variant = law_type:law_mercantilism
		}
		change_variable = {
			name = liberty_index_var
			add = 1
		}
		change_variable = {
			name = equality_index_var
			add = 1
		}
	}
	# Taxation
	if = {
		limit = {
			has_law_or_variant = law_type:law_graduated_taxation
		}
		change_variable = {
			name = equality_index_var
			add = 12
		}
		change_variable = {
			name = liberty_index_var
			add = 3
		}
	}
	else_if = {
		limit = {
			has_law_or_variant = law_type:law_proportional_taxation
		}
		change_variable = {
			name = equality_index_var
			add = 7
		}
		change_variable = {
			name = liberty_index_var
			add = 3
		}
	}
	else_if = {
		limit = {
			has_law_or_variant = law_type:law_per_capita_based_taxation
		}
		change_variable = {
			name = equality_index_var
			add = 4
		}
		change_variable = {
			name = liberty_index_var
			add = 2
		}
	}
	else_if = {
		limit = {
			has_law_or_variant = law_type:law_land_based_taxation
		}
		change_variable = {
			name = equality_index_var
			add = 8
		}
	}
	# Farming Policy
	if = {
		limit = {
			has_law_or_variant = law_type:law_peasant_proprietorship
		}
		change_variable = {
			name = liberty_index_var
			add = 5
		}
		change_variable = {
			name = equality_index_var
			add = 3
		}
	}
	else_if = {
		limit = {
			has_law_or_variant = law_type:law_commercialized_agriculture
		}
		change_variable = {
			name = liberty_index_var
			add = 4
		}
		change_variable = {
			name = equality_index_var
			add = 2
		}
	}
	else_if = {
		limit = {
			has_law_or_variant = law_type:law_tenant_farmers
		}
		change_variable = {
			name = liberty_index_var
			add = 2
		}
	}
	else_if = {
		limit = {
			has_law_or_variant = law_type:law_collectivized_agriculture
		}
		change_variable = {
			name = liberty_index_var
			add = 1
		}
		change_variable = {
			name = equality_index_var
			add = 4
		}
	}
	# Cultural Policies
	# Data Rights
	if = {
		limit = {
			has_law_or_variant = law_type:law_multicultural
		}
		change_variable = {
			name = liberty_index_var
			add = 7
		}
		change_variable = {
			name = equality_index_var
			add = 5
		}
	}
	else_if = {
		limit = {
			has_law_or_variant = law_type:law_cultural_exclusion
		}
		change_variable = {
			name = liberty_index_var
			add = 4
		}
		change_variable = {
			name = equality_index_var
			add = 3
		}
	}
	else_if = {
		limit = {
			has_law_or_variant = law_type:law_racial_segregation
		}
		change_variable = {
			name = liberty_index_var
			add = 2
		}
	}
	# Police
	if = {
		limit = {
			has_law_or_variant = law_type:law_local_police
		}
		change_variable = {
			name = equality_index_var
			add = 1
		}
		change_variable = {
			name = liberty_index_var
			add = 5
		}
	}
	else_if = {
		limit = {
			has_law_or_variant = law_type:law_dedicated_police
		}
		change_variable = {
			name = equality_index_var
			add = 2
		}
		change_variable = {
			name = liberty_index_var
			add = 4
		}
	}
	# Education System
	if = {
		limit = {
			has_law_or_variant = law_type:law_public_schools
		}
		change_variable = {
			name = equality_index_var
			add = 5
		}
		change_variable = {
			name = liberty_index_var
			add = 2
		}
	}
	else_if = {
		limit = {
			has_law_or_variant = law_type:law_private_schools
		}
		change_variable = {
			name = equality_index_var
			add = 3
		}
		change_variable = {
			name = liberty_index_var
			add = 2
		}
	}
	else_if = {
		limit = {
			has_law_or_variant = law_type:law_religious_schools
		}
		change_variable = {
			name = equality_index_var
			add = 1
		}
	}
	# Advanced Education System - Child Rights
	if = {
		limit = {
			has_law_or_variant = law_type:law_public_universities
		}
		change_variable = {
			name = liberty_index_var
			add = 2
		}
		change_variable = {
			name = equality_index_var
			add = 4
		}
	}
	else_if = {
		limit = {
			has_law_or_variant = law_type:law_compulsory_secondary_school
		}
		change_variable = {
			name = liberty_index_var
			add = 2
		}
		change_variable = {
			name = equality_index_var
			add = 3
		}
	}
	else_if = {
		limit = {
			has_law_or_variant = law_type:law_compulsory_primary_school
		}
		change_variable = {
			name = liberty_index_var
			add = 1
		}
		change_variable = {
			name = equality_index_var
			add = 2
		}
	}
	else_if = {
		limit = {
			has_law_or_variant = law_type:law_restricted_child_labor
		}
		change_variable = {
			name = liberty_index_var
			add = 1
		}
		change_variable = {
			name = equality_index_var
			add = 1
		}
	}
	# Health System
	if = {
		limit = {
			OR = {
				has_law_or_variant = law_type:law_private_health_insurance
				has_law_or_variant = law_type:law_charitable_health_system
			}
		}
		change_variable = {
			name = equality_index_var
			add = 3
		}
		change_variable = {
			name = liberty_index_var
			add = 2
		}
	}
	else_if = {
		limit = {
			has_law_or_variant = law_type:law_public_health_insurance
		}
		change_variable = {
			name = equality_index_var
			add = 9
		}
		change_variable = {
			name = liberty_index_var
			add = 2
		}
	}
	# Free Speech
	if = {
		limit = {
			has_law_or_variant = law_type:law_protected_speech
		}
		change_variable = {
			name = liberty_index_var
			add = 12
		}
	}
	else_if = {
		limit = {
			has_law_or_variant = law_type:law_right_of_assembly
		}
		change_variable = {
			name = liberty_index_var
			add = 8
		}
	}
	else_if = {
		limit = {
			has_law_or_variant = law_type:law_censorship
		}
		change_variable = {
			name = liberty_index_var
			add = 3
		}
	}
	# Labor Rights
	if = {
		limit = {
			has_law_or_variant = law_type:law_worker_protections
		}
		change_variable = {
			name = equality_index_var
			add = 8
		}
	}
	else_if = {
		limit = {
			has_law_or_variant = law_type:law_regulatory_bodies
		}
		change_variable = {
			name = equality_index_var
			add = 4
		}
	}
	# Welfare
	if = {
		limit = {
			has_law_or_variant = law_type:law_old_age_pension
		}
		change_variable = {
			name = equality_index_var
			add = 9
		}
		change_variable = {
			name = liberty_index_var
			add = 2
		}
	}
	else_if = {
		limit = {
			has_law_or_variant = law_type:law_wage_subsidies
		}
		change_variable = {
			name = equality_index_var
			add = 6
		}
		change_variable = {
			name = liberty_index_var
			add = 2
		}
	}
	else_if = {
		limit = {
			has_law_or_variant = law_type:law_poor_laws
		}
		change_variable = {
			name = equality_index_var
			add = 3
		}
		change_variable = {
			name = liberty_index_var
			add = 2
		}
	}
	# Labor Associations
	if = {
		limit = {
			has_law_or_variant = law_type:law_right_to_associate
		}
		change_variable = {
			name = equality_index_var
			add = 7
		}
		change_variable = {
			name = liberty_index_var
			add = 4
		}
	}
	else_if = {
		limit = {
			has_law_or_variant = law_type:law_corporatized_unions
		}
		change_variable = {
			name = equality_index_var
			add = 5
		}
		change_variable = {
			name = liberty_index_var
			add = 2
		}
	}
	else_if = {
		limit = {
			has_law_or_variant = law_type:law_guild_system
		}
		change_variable = {
			name = equality_index_var
			add = 3
		}
		change_variable = {
			name = liberty_index_var
			add = 2
		}
	}
	else_if = {
		limit = {
			has_law_or_variant = law_type:law_anti_strike_laws
		}
		change_variable = {
			name = equality_index_var
			add = 2
		}
		change_variable = {
			name = liberty_index_var
			add = 1
		}
	}
	# Women's Rights - LGBTQ+ Rights
	if = {
		limit = {
			OR = {
				has_law_or_variant = law_type:lgbtq_full_gender_equality
				has_law_or_variant = law_type:lgbtq_civil_unions
			}
		}
		change_variable = {
			name = liberty_index_var
			add = 6
		}
		change_variable = {
			name = equality_index_var
			add = 5
		}
	}
	else_if = {
		limit = {
			has_law_or_variant = law_type:lgbtq_sex_equality
		}
		change_variable = {
			name = liberty_index_var
			add = 5
		}
		change_variable = {
			name = equality_index_var
			add = 4
		}
	}
	else_if = {
		limit = {
			has_law_or_variant = law_type:law_womens_suffrage
		}
		change_variable = {
			name = liberty_index_var
			add = 4
		}
		change_variable = {
			name = equality_index_var
			add = 3
		}
	}
	else_if = {
		limit = {
			has_law_or_variant = law_type:law_women_in_the_workplace
		}
		change_variable = {
			name = liberty_index_var
			add = 2
		}
		change_variable = {
			name = equality_index_var
			add = 2
		}
	}
	else_if = {
		limit = {
			has_law_or_variant = law_type:law_women_own_property
		}
		change_variable = {
			name = liberty_index_var
			add = 1
		}
		change_variable = {
			name = equality_index_var
			add = 1
		}
	}
	# Life Rights
	if = {
		limit = {
			has_law_or_variant = law_type:law_abortion
		}
		change_variable = {
			name = liberty_index_var
			add = 4
		}
	}
	else_if = {
		limit = {
			has_law_or_variant = law_type:law_euthanasia
		}
		change_variable = {
			name = liberty_index_var
			add = 3
		}
	}
	else_if = {
		limit = {
			has_law_or_variant = law_type:law_regulated_adoption
		}
		change_variable = {
			name = liberty_index_var
			add = 2
		}
	}
	# Data Rights
	if = {
		limit = {
			has_law_or_variant = law_type:law_data_biometric_ban
		}
		change_variable = {
			name = liberty_index_var
			add = 3
		}
		change_variable = {
			name = equality_index_var
			add = 2
		}
	}
	else_if = {
		limit = {
			has_law_or_variant = law_type:law_data_privacy_basic
		}
		change_variable = {
			name = liberty_index_var
			add = 2
		}
		change_variable = {
			name = equality_index_var
			add = 1
		}
	}
}

# There are some laws that will cap the maximum liberty index a country can have
calculate_max_liberty_index = {
	if = {
		limit = {
			var:liberty_index_var > 35
			has_law_or_variant = law_type:law_single_party_state
		}
		remove_variable = liberty_index_var
		set_variable = {
			name = liberty_index_var
			value = 35
		}
	}
	else_if = {
		limit = {
			var:liberty_index_var > 45
			has_law_or_variant = law_type:law_autocracy
		}
		remove_variable = liberty_index_var
		set_variable = {
			name = liberty_index_var
			value = 45
		}
	}
	else_if = {
		limit = {
			var:liberty_index_var > 49
			has_law_or_variant = law_type:law_oligarchy
		}
		remove_variable = liberty_index_var
		set_variable = {
			name = liberty_index_var
			value = 49
		}
	}
	else_if = {
		limit = {
			var:liberty_index_var > 55
			OR = {
				has_law_or_variant = law_type:law_technocracy
				has_law_or_variant = law_type:law_landed_voting
				has_law_or_variant = law_type:law_wealth_voting
			}
		}
		remove_variable = liberty_index_var
		set_variable = {
			name = liberty_index_var
			value = 55
		}
	}
	else_if = {
		limit = {
			var:liberty_index_var > 65
			has_law_or_variant = law_type:law_census_voting
		}
		remove_variable = liberty_index_var
		set_variable = {
			name = liberty_index_var
			value = 65
		}
	}
	if = {
		limit = {
			var:liberty_index_var > 100
		}
		remove_variable = liberty_index_var
		set_variable = {
			name = liberty_index_var
			value = 100
		}
	}
	else_if = {
		limit = {
			var:liberty_index_var < 0
		}
		remove_variable = liberty_index_var
		set_variable = {
			name = liberty_index_var
			value = 0
		}
	}
}

calculate_liberty_equality_index_bpm = {
	# Here we give cake only if the law gives more liberty than worst case, which will always value 0
	set_variable = {
		name = liberty_index_var
		value = 0
	}
	set_variable = {
		name = equality_index_var
		value = 0
	}
	# Governance Principles
	if = {
		limit = {
			has_law_or_variant = law_type:law_parliamentary_republic
		}
		change_variable = {
			name = liberty_index_var
			add = 5
		}
		change_variable = {
			name = equality_index_var
			add = 1
		}
	}
	else_if = {
		limit = {
			OR = {
				has_law_or_variant = law_type:law_monarchy
				has_law_or_variant = law_type:law_presidential_republic
			}
		}
		change_variable = {
			name = liberty_index_var
			add = 3
		}
	}
	else_if = {
		limit = {
			has_law_or_variant = law_type:law_council_republic
		}
		change_variable = {
			name = liberty_index_var
			add = 1
		}
		change_variable = {
			name = equality_index_var
			add = 2
		}
	}
	# Distribution of Power
	if = {
		limit = {
			has_law_or_variant = law_type:law_universal_suffrage
		}
		change_variable = {
			name = liberty_index_var
			add = 12
		}
		change_variable = {
			name = equality_index_var
			add = 5
		}
	}
	else_if = {
		limit = {
			has_law_or_variant = law_type:law_organic_democracy
		}
		change_variable = {
			name = liberty_index_var
			add = 10
		}
		change_variable = {
			name = equality_index_var
			add = 4
		}
	}
	else_if = {
		limit = {
			has_law_or_variant = law_type:law_census_voting
		}
		change_variable = {
			name = liberty_index_var
			add = 8
		}
		change_variable = {
			name = equality_index_var
			add = 3
		}
	}
	else_if = {
		limit = {
			has_law_or_variant = law_type:law_wealth_voting
		}
		change_variable = {
			name = liberty_index_var
			add = 6
		}
		change_variable = {
			name = equality_index_var
			add = 2
		}
	}
	else_if = {
		limit = {
			has_law_or_variant = law_type:law_landed_voting
		}
		change_variable = {
			name = liberty_index_var
			add = 4
		}
		change_variable = {
			name = equality_index_var
			add = 1
		}
	}
	else_if = {
		limit = {
			has_law_or_variant = law_type:law_anarchy
		}
		change_variable = {
			name = liberty_index_var
			add = 1
		}
		change_variable = {
			name = equality_index_var
			add = 1
		}
	}
	else_if = {
		limit = {
			has_law_or_variant = law_type:law_technocracy
		}
		change_variable = {
			name = liberty_index_var
			add = 1
		}
	}
	else_if = {
		limit = {
			has_law_or_variant = law_type:law_elder_council
		}
		change_variable = {
			name = liberty_index_var
			add = 1
		}
	}
	else_if = {
		limit = {
			has_law = law_type:law_organic_regulation
		}
		change_variable = {
			name = liberty_index_var
			add = 2
		}
		change_variable = {
			name = equality_index_var
			add = 1
		}
	}
	else_if = {
		limit = {
			has_law_or_variant = law_type:law_oligarchy
		}
		change_variable = {
			name = liberty_index_var
			add = 1
		}
	}
	else_if = {
		limit = {
			has_law = law_type:law_neo_absolutism
		}
		change_variable = {
			name = liberty_index_var
			add = 2
		}
	}
	else_if = {
		limit = {
			has_law_or_variant = law_type:law_autocracy
		}
		change_variable = {
			name = liberty_index_var
			add = 1
		}
	}
	else_if = {
		limit = {
			has_law_or_variant = law_type:law_military_junta
		}
		change_variable = {
			name = liberty_index_var
			add = 1
		}
	}
	else_if = {
		limit = {
			has_law_or_variant = law_type:law_single_party_state
		}
		change_variable = {
			name = liberty_index_var
			add = 1
		}
	}
	else_if = {
		limit = {
			has_law_or_variant = law_type:law_colonial_admin
		}
		# very low representation
		change_variable = {
			name = liberty_index_var
			add = 0
		}
	}
	else = {
		change_variable = {
			name = liberty_index_var
			add = -2
		}
	}
	# Religion
	if = {
		limit = {
			has_law_or_variant = law_type:law_total_separation
		}
		change_variable = {
			name = liberty_index_var
			add = 4
		}
		change_variable = {
			name = equality_index_var
			add = 2
		}
	}
	else_if = {
		limit = {
			has_law_or_variant = law_type:law_freedom_of_conscience
		}
		change_variable = {
			name = liberty_index_var
			add = 3
		}
		change_variable = {
			name = equality_index_var
			add = 1
		}
	}
	else_if = {
		limit = {
			has_law_or_variant = law_type:law_state_atheism
		}
		change_variable = {
			name = liberty_index_var
			add = 2
		}
		change_variable = {
			name = equality_index_var
			add = 1
		}
	}
	# Bureaucracy
	if = {
		limit = {
			has_law_or_variant = law_type:law_elected_bureaucrats
		}
		change_variable = {
			name = liberty_index_var
			add = 3
		}
		change_variable = {
			name = equality_index_var
			add = 1
		}
	}
	else_if = {
		limit = {
			has_law_or_variant = law_type:law_appointed_bureaucrats
		}
		change_variable = {
			name = liberty_index_var
			add = 2
		}
		change_variable = {
			name = equality_index_var
			add = 1
		}
	}
	# Internal Security
	if = {
		limit = {
			has_law_or_variant = law_type:law_guaranteed_liberties
		}
		change_variable = {
			name = liberty_index_var
			add = 5
		}
	}
	else_if = {
		limit = {
			has_law_or_variant = law_type:law_no_home_affairs
		}
		change_variable = {
			name = liberty_index_var
			add = 3
		}
	}
	else_if = {
		limit = {
			has_law_or_variant = law_type:law_secret_police
		}
		change_variable = {
			name = liberty_index_var
			add = 2
		}
	}
	# Economic System
	if = {
		limit = {
			has_law_or_variant = law_type:law_laissez_faire
		}
		change_variable = {
			name = liberty_index_var
			add = 3
		}
		change_variable = {
			name = equality_index_var
			add = 2
		}
	}
	else_if = {
		limit = {
			has_law_or_variant = law_type:law_interventionism
		}
		change_variable = {
			name = liberty_index_var
			add = 2
		}
		change_variable = {
			name = equality_index_var
			add = 7
		}
	}
	else_if = {
		limit = {
			OR = {
				has_law_or_variant = law_type:law_cooperative_ownership
				has_law_or_variant = law_type:law_agrarianism
			}
		}
		change_variable = {
			name = liberty_index_var
			add = 1
		}
		change_variable = {
			name = equality_index_var
			add = 5
		}
	}
	else_if = {
		limit = {
			has_law_or_variant = law_type:law_command_economy
		}
		change_variable = {
			name = equality_index_var
			add = 11
		}
	}
	# Trade Policy
	if = {
		limit = {
			has_law_or_variant = law_type:law_free_trade
		}
		change_variable = {
			name = liberty_index_var
			add = 5
		}
		change_variable = {
			name = equality_index_var
			add = 2
		}
	}
	else_if = {
		limit = {
			has_law_or_variant = law_type:law_protectionism
		}
		change_variable = {
			name = liberty_index_var
			add = 3
		}
		change_variable = {
			name = equality_index_var
			add = 2
		}
	}
	else_if = {
		limit = {
			has_law_or_variant = law_type:law_mercantilism
		}
		change_variable = {
			name = liberty_index_var
			add = 1
		}
		change_variable = {
			name = equality_index_var
			add = 1
		}
	}
	# Taxation
	if = {
		limit = {
			has_law_or_variant = law_type:law_graduated_taxation
		}
		change_variable = {
			name = equality_index_var
			add = 9
		}
		change_variable = {
			name = liberty_index_var
			add = 3
		}
	}
	else_if = {
		limit = {
			has_law_or_variant = law_type:law_proportional_taxation
		}
		change_variable = {
			name = equality_index_var
			add = 5
		}
		change_variable = {
			name = liberty_index_var
			add = 3
		}
	}
	else_if = {
		limit = {
			has_law_or_variant = law_type:law_per_capita_based_taxation
		}
		change_variable = {
			name = equality_index_var
			add = 3
		}
		change_variable = {
			name = liberty_index_var
			add = 2
		}
	}
	else_if = {
		limit = {
			has_law_or_variant = law_type:law_land_based_taxation
		}
		change_variable = {
			name = equality_index_var
			add = 6
		}
	}
	# Farming Policy
	if = {
		limit = {
			has_law_or_variant = law_type:law_peasant_proprietorship
		}
		change_variable = {
			name = liberty_index_var
			add = 4
		}
		change_variable = {
			name = equality_index_var
			add = 3
		}
	}
	else_if = {
		limit = {
			has_law_or_variant = law_type:law_commercialized_agriculture
		}
		change_variable = {
			name = liberty_index_var
			add = 3
		}
		change_variable = {
			name = equality_index_var
			add = 2
		}
	}
	else_if = {
		limit = {
			has_law_or_variant = law_type:law_tenant_farmers
		}
		change_variable = {
			name = liberty_index_var
			add = 2
		}
	}
	else_if = {
		limit = {
			has_law_or_variant = law_type:law_collectivized_agriculture
		}
		change_variable = {
			name = liberty_index_var
			add = 1
		}
		change_variable = {
			name = equality_index_var
			add = 3
		}
	}
	# Cultural Policies
	# Data Rights (Cultura)
	if = {
		limit = {
			has_law_or_variant = law_type:law_multicultural
		}
		change_variable = {
			name = liberty_index_var
			add = 5
		}
		change_variable = {
			name = equality_index_var
			add = 4
		}
	}
	else_if = {
		limit = {
			has_law_or_variant = law_type:law_multicultural_upgraded
		}
		change_variable = {
			name = liberty_index_var
			add = 6
		}
		change_variable = {
			name = equality_index_var
			add = 5
		}
	}
	else_if = {
		limit = {
			has_law_or_variant = law_type:law_cultural_exclusion
		}
		change_variable = {
			name = liberty_index_var
			add = 3
		}
		change_variable = {
			name = equality_index_var
			add = 2
		}
	}
	else_if = {
		limit = {
			has_law_or_variant = law_type:law_racial_segregation
		}
		change_variable = {
			name = liberty_index_var
			add = 1
		}
	}
	# Police
	if = {
		limit = {
			has_law_or_variant = law_type:law_no_police
		}
		change_variable = {
			name = liberty_index_var
			add = 5
		}
	}
	else_if = {
		limit = {
			has_law_or_variant = law_type:law_elected_police
		}
		change_variable = {
			name = equality_index_var
			add = 2
		}
		change_variable = {
			name = liberty_index_var
			add = 5
		}
	}
	else_if = {
		limit = {
			has_law_or_variant = law_type:law_local_police
		}
		change_variable = {
			name = equality_index_var
			add = 1
		}
		change_variable = {
			name = liberty_index_var
			add = 4
		}
	}
	else_if = {
		limit = {
			has_law_or_variant = law_type:law_dedicated_police
		}
		change_variable = {
			name = equality_index_var
			add = 2
		}
		change_variable = {
			name = liberty_index_var
			add = 3
		}
	}
	else_if = {
		limit = {
			has_law_or_variant = law_type:law_militarized_police
		}
		change_variable = {
			name = equality_index_var
			add = 1
		}
		change_variable = {
			name = liberty_index_var
			add = 2
		}
	}
	# Education System
	if = {
		limit = {
			has_law_or_variant = law_type:law_public_schools
		}
		change_variable = {
			name = equality_index_var
			add = 4
		}
		change_variable = {
			name = liberty_index_var
			add = 2
		}
	}
	else_if = {
		limit = {
			has_law_or_variant = law_type:law_private_schools
		}
		change_variable = {
			name = equality_index_var
			add = 3
		}
		change_variable = {
			name = liberty_index_var
			add = 2
		}
	}
	else_if = {
		limit = {
			has_law_or_variant = law_type:law_religious_schools
		}
		change_variable = {
			name = equality_index_var
			add = 1
		}
	}
	# Advanced Education System - Child Rights
	if = {
		limit = {
			has_law_or_variant = law_type:law_public_universities
		}
		change_variable = {
			name = liberty_index_var
			add = 2
		}
		change_variable = {
			name = equality_index_var
			add = 4
		}
	}
	else_if = {
		limit = {
			has_law_or_variant = law_type:law_compulsory_secondary_school
		}
		change_variable = {
			name = liberty_index_var
			add = 2
		}
		change_variable = {
			name = equality_index_var
			add = 3
		}
	}
	else_if = {
		limit = {
			has_law_or_variant = law_type:law_compulsory_primary_school
		}
		change_variable = {
			name = liberty_index_var
			add = 1
		}
		change_variable = {
			name = equality_index_var
			add = 2
		}
	}
	else_if = {
		limit = {
			has_law_or_variant = law_type:law_restricted_child_labor
		}
		change_variable = {
			name = liberty_index_var
			add = 1
		}
		change_variable = {
			name = equality_index_var
			add = 1
		}
	}
	# Health System
	if = {
		limit = {
			OR = {
				has_law_or_variant = law_type:law_private_health_insurance
				has_law_or_variant = law_type:law_charitable_health_system
			}
		}
		change_variable = {
			name = equality_index_var
			add = 3
		}
		change_variable = {
			name = liberty_index_var
			add = 2
		}
	}
	else_if = {
		limit = {
			has_law_or_variant = law_type:law_public_health_insurance
		}
		change_variable = {
			name = equality_index_var
			add = 6
		}
		change_variable = {
			name = liberty_index_var
			add = 2
		}
	}
	# Free Speech
	if = {
		limit = {
			has_law_or_variant = law_type:law_protected_speech
		}
		change_variable = {
			name = liberty_index_var
			add = 8
		}
	}
	else_if = {
		limit = {
			has_law_or_variant = law_type:law_right_of_assembly
		}
		change_variable = {
			name = liberty_index_var
			add = 6
		}
	}
	else_if = {
		limit = {
			has_law_or_variant = law_type:law_censorship
		}
		change_variable = {
			name = liberty_index_var
			add = 3
		}
	}
	# Labor Rights
	if = {
		limit = {
			has_law_or_variant = law_type:law_worker_protections
		}
		change_variable = {
			name = equality_index_var
			add = 6
		}
	}
	else_if = {
		limit = {
			has_law_or_variant = law_type:law_regulatory_bodies
		}
		change_variable = {
			name = equality_index_var
			add = 3
		}
	}
	# Welfare
	if = {
		limit = {
			has_law_or_variant = law_type:law_old_age_pension
		}
		change_variable = {
			name = equality_index_var
			add = 6
		}
		change_variable = {
			name = liberty_index_var
			add = 1
		}
	}
	else_if = {
		limit = {
			has_law_or_variant = law_type:law_wage_subsidies
		}
		change_variable = {
			name = equality_index_var
			add = 4
		}
		change_variable = {
			name = liberty_index_var
			add = 1
		}
	}
	else_if = {
		limit = {
			has_law_or_variant = law_type:law_poor_laws
		}
		change_variable = {
			name = equality_index_var
			add = 3
		}
		change_variable = {
			name = liberty_index_var
			add = 1
		}
	}
	# Labor Associations
	if = {
		limit = {
			has_law_or_variant = law_type:law_right_to_associate
		}
		change_variable = {
			name = equality_index_var
			add = 6
		}
		change_variable = {
			name = liberty_index_var
			add = 3
		}
	}
	else_if = {
		limit = {
			has_law_or_variant = law_type:law_corporatized_unions
		}
		change_variable = {
			name = equality_index_var
			add = 4
		}
		change_variable = {
			name = liberty_index_var
			add = 2
		}
	}
	else_if = {
		limit = {
			has_law_or_variant = law_type:law_guild_system
		}
		change_variable = {
			name = equality_index_var
			add = 3
		}
		change_variable = {
			name = liberty_index_var
			add = 2
		}
	}
	else_if = {
		limit = {
			has_law_or_variant = law_type:law_anti_strike_laws
		}
		change_variable = {
			name = equality_index_var
			add = 2
		}
		change_variable = {
			name = liberty_index_var
			add = 1
		}
	}
	else_if = {
		limit = {
			has_law_or_variant = law_type:law_combination_acts
		}
		change_variable = {
			name = equality_index_var
			add = 1
		}
		change_variable = {
			name = liberty_index_var
			add = 1
		}
	}
	else_if = {
		limit = {
			has_law_or_variant = law_type:law_syndicalism
		}
		change_variable = {
			name = equality_index_var
			add = 7
		}
		change_variable = {
			name = liberty_index_var
			add = 3
		}
	}
	else_if = {
		limit = {
			has_law_or_variant = law_type:law_socialist_labor_unions
		}
		change_variable = {
			name = equality_index_var
			add = 6
		}
		change_variable = {
			name = liberty_index_var
			add = 3
		}
	}
	# Women's Rights - LGBTQ+ Rights
	if = {
		limit = {
			OR = {
				has_law_or_variant = law_type:lgbtq_full_gender_equality
				has_law_or_variant = law_type:lgbtq_civil_unions
			}
		}
		change_variable = {
			name = liberty_index_var
			add = 5
		}
		change_variable = {
			name = equality_index_var
			add = 4
		}
	}
	else_if = {
		limit = {
			has_law_or_variant = law_type:lgbtq_sex_equality
		}
		change_variable = {
			name = liberty_index_var
			add = 5
		}
		change_variable = {
			name = equality_index_var
			add = 3
		}
	}
	else_if = {
		limit = {
			has_law_or_variant = law_type:law_womens_suffrage_upgraded
		}
		change_variable = {
			name = liberty_index_var
			add = 4
		}
		change_variable = {
			name = equality_index_var
			add = 4
		}
	}
	else_if = {
		limit = {
			has_law_or_variant = law_type:law_womens_suffrage
		}
		change_variable = {
			name = liberty_index_var
			add = 4
		}
		change_variable = {
			name = equality_index_var
			add = 3
		}
	}
	else_if = {
		limit = {
			has_law_or_variant = law_type:law_women_in_the_workplace
		}
		change_variable = {
			name = liberty_index_var
			add = 2
		}
		change_variable = {
			name = equality_index_var
			add = 2
		}
	}
	else_if = {
		limit = {
			has_law_or_variant = law_type:law_women_own_property
		}
		change_variable = {
			name = liberty_index_var
			add = 1
		}
		change_variable = {
			name = equality_index_var
			add = 1
		}
	}
	# Life Rights
	if = {
		limit = {
			has_law_or_variant = law_type:law_abortion
		}
		change_variable = {
			name = liberty_index_var
			add = 3
		}
	}
	else_if = {
		limit = {
			has_law_or_variant = law_type:law_euthanasia
		}
		change_variable = {
			name = liberty_index_var
			add = 3
		}
	}
	else_if = {
		limit = {
			has_law_or_variant = law_type:law_regulated_adoption
		}
		change_variable = {
			name = liberty_index_var
			add = 2
		}
	}
	# Data Rights (Dati & Privacy)
	if = {
		limit = {
			has_law_or_variant = law_type:law_data_biometric_ban
		}
		change_variable = {
			name = liberty_index_var
			add = 3
		}
		change_variable = {
			name = equality_index_var
			add = 2
		}
	}
	else_if = {
		limit = {
			has_law_or_variant = law_type:law_data_privacy_basic
		}
		change_variable = {
			name = liberty_index_var
			add = 2
		}
		change_variable = {
			name = equality_index_var
			add = 1
		}
	}
	# Work Time Regulations
	if = {
		limit = {
			has_law_or_variant = law_type:law_protected_leisure
		}
		change_variable = {
			name = equality_index_var
			add = 6
		}
		change_variable = {
			name = liberty_index_var
			add = 1
		}
	}
	else_if = {
		limit = {
			has_law_or_variant = law_type:law_limited_work_hours
		}
		change_variable = {
			name = equality_index_var
			add = 4
		}
		change_variable = {
			name = liberty_index_var
			add = 1
		}
	}
	else_if = {
		limit = {
			has_law_or_variant = law_type:law_token_time_regulations
		}
		change_variable = {
			name = equality_index_var
			add = 1
		}
	}
	else_if = {
		limit = {
			has_law_or_variant = law_type:law_unregulated_work_time
		}
		change_variable = {
			name = liberty_index_var
			add = 2
		}
	}
	# Officers
	if = {
		limit = {
			has_law_or_variant = law_type:law_elected_officers
		}
		change_variable = {
			name = liberty_index_var
			add = 3
		}
		change_variable = {
			name = equality_index_var
			add = 1
		}
	}
	else_if = {
		limit = {
			has_law_or_variant = law_type:law_professional_officers
		}
		change_variable = {
			name = liberty_index_var
			add = 1
		}
	}
	else_if = {
		limit = {
			has_law_or_variant = law_type:law_political_officers
		}
		change_variable = {
			name = liberty_index_var
			add = 0
		}
	}
	else_if = {
		limit = {
			has_law_or_variant = law_type:law_purchased_officers
		}
		change_variable = {
			name = liberty_index_var
			add = 0
		}
	}
	else_if = {
		limit = {
			has_law_or_variant = law_type:law_noble_officers
		}
		change_variable = {
			name = liberty_index_var
			add = 0
		}
	}
	# Legislative Principles
	if = {
		limit = {
			has_law_or_variant = law_type:law_separated_powers
		}
		change_variable = {
			name = liberty_index_var
			add = 4
		}
		change_variable = {
			name = equality_index_var
			add = 1
		}
	}
	else_if = {
		limit = {
			has_law_or_variant = law_type:law_supreme_legislature
		}
		change_variable = {
			name = liberty_index_var
			add = 3
		}
		change_variable = {
			name = equality_index_var
			add = 1
		}
	}
	else_if = {
		limit = {
			has_law_or_variant = law_type:law_advisory_body
		}
		change_variable = {
			name = liberty_index_var
			add = 1
		}
	}
	# Executive Principles
	if = {
		limit = {
			has_law_or_variant = law_type:law_answers_to_legislature
		}
		change_variable = {
			name = liberty_index_var
			add = 4
		}
		change_variable = {
			name = equality_index_var
			add = 1
		}
	}
	else_if = {
		limit = {
			has_law_or_variant = law_type:law_no_separate_hog
		}
		change_variable = {
			name = liberty_index_var
			add = 3
		}
		change_variable = {
			name = equality_index_var
			add = 1
		}
	}
	else_if = {
		limit = {
			has_law_or_variant = law_type:law_appointed_on_advice
		}
		change_variable = {
			name = liberty_index_var
			add = 2
		}
	}
	# Party Laws
	if = {
		limit = {
			has_law_or_variant = law_type:law_no_party_bans
		}
		change_variable = {
			name = liberty_index_var
			add = 4
		}
		change_variable = {
			name = equality_index_var
			add = 2
		}
	}
	else_if = {
		limit = {
			has_law_or_variant = law_type:law_party_liberal_only
		}
		change_variable = {
			name = liberty_index_var
			add = 2
		}
		change_variable = {
			name = equality_index_var
			add = 1
		}
	}
	else_if = {
		limit = {
			has_law_or_variant = law_type:law_party_socialist_only
		}
		change_variable = {
			name = liberty_index_var
			add = 1
		}
		change_variable = {
			name = equality_index_var
			add = 3
		}
	}
	else_if = {
		limit = {
			has_law_or_variant = law_type:law_party_reactionary_only
		}
		change_variable = {
			name = liberty_index_var
			add = 1
		}
	}
	else_if = {
		limit = {
			has_law_or_variant = law_type:law_party_anti_liberal
		}
		change_variable = {
			name = liberty_index_var
			add = 2
		}
		change_variable = {
			name = equality_index_var
			add = 1
		}
	}
	else_if = {
		limit = {
			has_law_or_variant = law_type:law_party_anti_socialist
		}
		change_variable = {
			name = liberty_index_var
			add = 2
		}
		change_variable = {
			name = equality_index_var
			add = 1
		}
	}
	else_if = {
		limit = {
			has_law_or_variant = law_type:law_party_anti_reactionary
		}
		change_variable = {
			name = liberty_index_var
			add = 2
		}
		change_variable = {
			name = equality_index_var
			add = 1
		}
	}
	else_if = {
		limit = {
			has_law_or_variant = law_type:law_party_single
		}
		change_variable = {
			name = liberty_index_var
			add = 1
		}
	}
	# Foreign Policy
	if = {
		limit = {
			has_law_or_variant = law_type:law_disarmed_nation
		}
		change_variable = {
			name = equality_index_var
			add = 3
		}
		change_variable = {
			name = liberty_index_var
			add = 1
		}
	}
	else_if = {
		limit = {
			has_law_or_variant = law_type:law_dove_politics
		}
		change_variable = {
			name = liberty_index_var
			add = 3
		}
		change_variable = {
			name = equality_index_var
			add = 1
		}
	}
	else_if = {
		limit = {
			has_law_or_variant = law_type:law_armed_neutrality
		}
		change_variable = {
			name = liberty_index_var
			add = 2
		}
		change_variable = {
			name = equality_index_var
			add = 1
		}
	}
	else_if = {
		limit = {
			has_law_or_variant = law_type:law_justum_bellum
		}
		change_variable = {
			name = liberty_index_var
			add = 2
		}
		change_variable = {
			name = equality_index_var
			add = 1
		}
	}
	else_if = {
		limit = {
			has_law_or_variant = law_type:law_flexible_foreign_policy
		}
		change_variable = {
			name = liberty_index_var
			add = 2
		}
	}
	else_if = {
		limit = {
			has_law_or_variant = law_type:law_jingoism
		}
		change_variable = {
			name = liberty_index_var
			add = 1
		}
	}
	# Centralization
	if = {
		limit = {
			has_law_or_variant = law_type:law_devolved
		}
		change_variable = {
			name = liberty_index_var
			add = 3
		}
		change_variable = {
			name = equality_index_var
			add = 2
		}
	}
	else_if = {
		limit = {
			has_law_or_variant = law_type:law_federated
		}
		change_variable = {
			name = liberty_index_var
			add = 2
		}
		change_variable = {
			name = equality_index_var
			add = 2
		}
	}
	else_if = {
		limit = {
			has_law_or_variant = law_type:law_confederated
		}
		change_variable = {
			name = liberty_index_var
			add = 1
		}
		change_variable = {
			name = equality_index_var
			add = 1
		}
	}
	else_if = {
		limit = {
			has_law_or_variant = law_type:law_unitary
		}
		change_variable = {
			name = liberty_index_var
			add = 1
		}
		change_variable = {
			name = equality_index_var
			add = 2
		}
	}
	else_if = {
		limit = {
			has_law_or_variant = law_type:law_ad_hoc_centralization
		}
		change_variable = {
			name = liberty_index_var
			add = 1
		}
	}
}
