on_actions = {
	on_startup = {
		effect = {
			QIN = {
			    add_opinion_modifier = { target = JAP modifier = QIN_fuck_CPS }
				add_opinion_modifier = { target = CHI modifier = QIN_fuck_CPS }
				add_opinion_modifier = { target = GAN modifier = QIN_fuck_CPS }
				SAMPLE_init_parliament = yes
				set_variable = { var = vote_timer value = 0 }
				set_variable = { var = QIN_legyuan_days_since_last_vote value = 0 }
			}
			JAP = {
			    add_opinion_modifier = { target = QIN modifier = QIN_fuck_CPS }
			}
			CHI = {
			    add_opinion_modifier = { target = QIN modifier = QIN_fuck_CPS }
			}
			GAN = {
			    add_opinion_modifier = { target = QIN modifier = QIN_fuck_CPS }
			}
		}
	}
	on_daily = {
    	effect = {
			if = {
				limit = { original_tag = QIN }
				if = {
					limit = { NOT = { has_country_flag = act_vote_in_progress } }
					QIN_sync_party_seats_from_popularity = yes
				}
    	    	if = {
    	    	    limit = { has_country_flag = act_vote_in_progress }
					if = {
						limit = {
							check_variable = {
								var = vote_timer
								value = 0
								compare = less_than_or_equals
							}
						}
						set_variable = { var = vote_timer value = 0 }
    	    	        clr_country_flag = act_vote_in_progress
    	    	        country_event = { id = legyuan.30 }
    	    	    }
					else = {
    	    	    	add_to_variable = { var = vote_timer value = -1 }
    	    	    	if = {
    	    	    	    limit = {
								check_variable = {
									var = vote_timer
									value = 0
									compare = less_than_or_equals
								}
							}
							set_variable = { var = vote_timer value = 0 }
    	    	    	    clr_country_flag = act_vote_in_progress
    	    	    	    country_event = { id = legyuan.30 }
    	    	    	}
					}
    	    	}
				else_if = {
					limit = {
						has_country_flag = QIN_LegYuan_Cooldown_2
						check_variable = {
							var = QIN_legyuan_days_since_last_vote
							value = 335
							compare = less_than
						}
					}
					add_to_variable = { var = QIN_legyuan_days_since_last_vote value = 1 }
				}
			}
    	}
	}
}
