on_actions = {
	on_startup = {
		effect = {
			PHI = {
				set_temp_variable = { coalition_partner_var = token:social_conservative }
				add_to_coalition = yes
			}
		}
	}

	#ROOT is winner #FROM gets annexed - For civil wars on_civil_war_end is also fired
	on_annex = {
		effect = {
			if = {
				limit = { original_tag = PHI }
				clr_country_flag = PHI_fight_for_the_philippines_active_flag
			}
		}
	}

	#ROOT is new controller #FROM is old controller #FROM.FROM is state ID
	on_state_control_changed = {
		effect = {
			if = {
				#Remove GEA from contention if they lose Singapore
				limit = {
					FROM = { tag = GEA }
					FROM.FROM = { state = 336 } #Singapore
					PHI = { has_country_flag = PHI_fight_for_the_philippines_active_flag }
				}
				PHI = { country_event = PHI.political.045 } #The Germans Depart From Manila
				GEA = { country_event = PHI.political.045 } #The Germans Depart From Manila
			}
			else_if = {
				#Remove JAP from contention if they lose Taiwan
				limit = {
					FROM = { tag = JAP }
					FROM.FROM = { state = 524 } #Taiwan
					PHI = { has_country_flag = PHI_fight_for_the_philippines_active_flag }
				}
				PHI = { country_event = PHI.political.046 } #The Japanese Depart From Manila
				JAP = { country_event = PHI.political.046 } #The Japanese Depart From Manila
			}
		}
	}
	#ROOT = attacking side
	#FROM = defending side
	#fired when two countries end up at war with each other (on_war is fired when a country goes to war against anyone and is not fired again when it enters war against another country unless it went to peace first)
	on_war_relation_added = {
		effect = {
			if = {
				limit = {
					ROOT = {
						OR = {
							tag = GEA
							tag = PHI
						}
					}
					FROM = {
						OR = {
							tag = GEA
							tag = PHI
						}
					}
				}
				PHI = { country_event = PHI.political.045 } #The Germans Pull Out of Manila
				GEA = { country_event = PHI.political.045 } #The Germans Pull Out of Manila
			}
			else_if = {
				limit = {
					ROOT = {
						OR = {
							tag = JAP
							tag = PHI
						}
					}
					FROM = {
						OR = {
							tag = JAP
							tag = PHI
						}
					}
				}
				PHI = { country_event = PHI.political.046 } #The Japanese Pull Out of Manila
				JAP = { country_event = PHI.political.046 } #The Japanese Pull Out of Manila
			}
		}
	}
	#ROOT = attacking side
	#FROM = defending side
	#fired when two countries end up at war with each other (on_war is fired when a country goes to war against anyone and is not fired again when it enters war against another country unless it went to peace first)
	on_war_relation_added = {
		effect = {
			if = {
				limit = {
					ROOT = {
						OR = {
							tag = USA
							tag = CSA
							tag = TXS
							tag = COR
						}
					}
					FROM = {
						OR = {
							tag = USA
							tag = CSA
							tag = TXS
							tag = COR
						}
					}
				}
				PHI = { country_event = { id = PHI.political.020 days = 2 } }#Philippines impacted by US Civil War
				USA = { country_event = { id = PHI.political.040 days = 5 } }#Philippines impacted by US Civil War
			}
		}
	}
}
