on_actions = {
	on_startup = {
		effect = {
			set_global_flag = lhe_is_active
		}
		effect = {
			ACH = {
				set_country_flag = lhe_no_easy_ledger_invite
			}
		}
	}
	on_weekly_BOS = {
		effect = {
			set_variable = {
				bos_ruler_pop = BOS.party_popularity_100@ruler
			}
			clamp_variable = { ##clamping so the effect can be ready (possibly) directly. Plus, no effect if pop > 33%.
				var = bos_ruler_pop 
				max = 33
				min = 0
			}
			set_variable = {
				bos_elites_pop = BOS.party_popularity_100@elites
			}
			clamp_variable = { ##clamping so the effect can be ready (possibly) directly. Plus, no effect if pop > 33%.
				var = bos_elites_pop 
				max = 33
				min = 0
			}
			set_variable = {
				bos_intellectuals_pop = BOS.party_popularity_100@intellectuals
			}
			clamp_variable = { ##clamping so the effect can be ready (possibly) directly. Plus, no effect if pop > 33%.
				var = bos_intellectuals_pop
				max = 33
				min = 0
			}
			set_variable = {
				bos_people_pop = BOS.party_popularity_100@people
			}
			divide_variable = {bos_intellectuals_pop = 50}
			clamp_variable = { ##clamping so the effect can be ready (possibly) directly. Plus, no effect if pop > 33%.
				var = bos_people_pop
				max = 33
				min = 0
			}
			divide_variable = {bos_elites_pop = 100} ##stability and war support need a decimal value
			divide_variable = {bos_ruler_pop = 100}
			divide_variable = {bos_people_pop = 2}	##33 weekly manpower is too much	
			set_variable = {
				bos_intellectuals_pop_negative = bos_intellectuals_pop
			}
			multiply_variable = {
				var = bos_intellectuals_pop_negative
				value = -1
			}
		}
		effect = {
			set_variable = {
				bos_inverse_tension = 100
			}
			subtract_from_variable = {
				bos_inverse_tension = BOS.bos_tension
			}
		}
	}
	## on_monthly_BOS = {
	## 	force_update_map_mode = {
	## 		limit = {
	## 			is_ai = no
	## 		}
	## 		mapmode = 
	## 	}
	## } 	

	on_state_control_changed = {
		effect = { ##basically a "Swap Ideas" equivelant for these two modifiers.
			if = {
				limit = { 
					FROM.FROM = { 
						OR = {
						has_dynamic_modifier = { modifier = bos_state_influence }
						has_dynamic_modifier = { modifier = bos_state_influence_bos_controlled }
						}
					}
				}
				if =  {
					limit = {
						tag = BOS ##this is ROOT implicitly, the new controller
					}
					FROM.FROM = { ##the state in question
						remove_dynamic_modifier = { modifier = bos_state_influence }
						add_dynamic_modifier = { modifier = bos_state_influence_bos_controlled }
					}
				}
				else = { 
					FROM.FROM = {
						add_dynamic_modifier = { modifier = bos_state_influence }
						remove_dynamic_modifier = { modifier = bos_state_influence_bos_controlled }
					}
				}
			}
		}
	}

}
