defined_text = {
    name = GetIfRootWillBecomeEmperorAfterwards

    text = {
        localisation_key = string_root_will_become_emperor_afterwards
        trigger = {
			NOT = { has_ruler_flag = zum_kaiser_gekroent }
        }
    }
	text = {
        localisation_key = string_root_will_not_become_emperor_afterwards
        trigger = {
			has_ruler_flag = zum_kaiser_gekroent
        }
    }
}

defined_text = {
    name = GetHREemperorKing
	random = no

    text = {
        localisation_key = string_hre_status_king
        trigger = {
			emperor = {
				religion = catholic
				NOT = { has_ruler_flag = zum_kaiser_gekroent }
			}
			NOT = { is_religion_enabled = protestant }
        }
    }
	text = {
        localisation_key = string_hre_status_emperor
        trigger = {
			always = yes
        }
    }
}

defined_text = {
    name = GetIfGovernmentRankIsReducedWhenJoiningHRE
	random = no

    text = {
        localisation_key = string_join_hre_old_government_rank_3
        trigger = {
			government_rank = 3
        }
    }
	text = {
        localisation_key = string_join_hre_old_government_rank_2
        trigger = {
			government_rank = 2
        }
    }
	text = {
        localisation_key = string_join_hre_old_government_rank_1
        trigger = {
			always = yes
        }
    }
}

defined_text = {
    name = GetNumberOfSecularElectors
	random = no

    text = {
        localisation_key = string_num_of_secular_or_ecclesiastical_electors_10
        trigger = {
			calc_true_if = {
				all_elector = {
					is_a_secular_country = yes
				}
				amount = 10
			}
        }
    }
	text = {
        localisation_key = string_num_of_secular_or_ecclesiastical_electors_9
        trigger = {
			calc_true_if = {
				all_elector = {
					is_a_secular_country = yes
				}
				amount = 9
			}
        }
    }
	text = {
        localisation_key = string_num_of_secular_or_ecclesiastical_electors_8
        trigger = {
			calc_true_if = {
				all_elector = {
					is_a_secular_country = yes
				}
				amount = 8
			}
        }
    }
	text = {
        localisation_key = string_num_of_secular_or_ecclesiastical_electors_7
        trigger = {
			calc_true_if = {
				all_elector = {
					is_a_secular_country = yes
				}
				amount = 7
			}
        }
    }
	text = {
        localisation_key = string_num_of_secular_or_ecclesiastical_electors_6
        trigger = {
			calc_true_if = {
				all_elector = {
					is_a_secular_country = yes
				}
				amount = 6
			}
        }
    }
	text = {
        localisation_key = string_num_of_secular_or_ecclesiastical_electors_5
        trigger = {
			calc_true_if = {
				all_elector = {
					is_a_secular_country = yes
				}
				amount = 5
			}
        }
    }
	text = {
        localisation_key = string_num_of_secular_or_ecclesiastical_electors_4
        trigger = {
			calc_true_if = {
				all_elector = {
					is_a_secular_country = yes
				}
				amount = 4
			}
        }
    }
	text = {
        localisation_key = string_num_of_secular_or_ecclesiastical_electors_3
        trigger = {
			calc_true_if = {
				all_elector = {
					is_a_secular_country = yes
				}
				amount = 3
			}
        }
    }
	text = {
        localisation_key = string_num_of_secular_or_ecclesiastical_electors_2
        trigger = {
			calc_true_if = {
				all_elector = {
					is_a_secular_country = yes
				}
				amount = 2
			}
        }
    }
	text = {
        localisation_key = string_num_of_secular_or_ecclesiastical_electors_1
        trigger = {
			calc_true_if = {
				all_elector = {
					is_a_secular_country = yes
				}
				amount = 1
			}
        }
    }
	text = {
        localisation_key = string_num_of_secular_or_ecclesiastical_electors_0
        trigger = {
			always = yes
        }
    }
}

defined_text = {
    name = GetNumberOfEcclesiasticalElectors
	random = no

    text = {
        localisation_key = string_num_of_secular_or_ecclesiastical_electors_10
        trigger = {
			calc_true_if = {
				all_elector = {
					is_an_ecclesiastical_country = yes
				}
				amount = 10
			}
        }
    }
	text = {
        localisation_key = string_num_of_secular_or_ecclesiastical_electors_9
        trigger = {
			calc_true_if = {
				all_elector = {
					is_an_ecclesiastical_country = yes
				}
				amount = 9
			}
        }
    }
	text = {
        localisation_key = string_num_of_secular_or_ecclesiastical_electors_8
        trigger = {
			calc_true_if = {
				all_elector = {
					is_an_ecclesiastical_country = yes
				}
				amount = 8
			}
        }
    }
	text = {
        localisation_key = string_num_of_secular_or_ecclesiastical_electors_7
        trigger = {
			calc_true_if = {
				all_elector = {
					is_an_ecclesiastical_country = yes
				}
				amount = 7
			}
        }
    }
	text = {
        localisation_key = string_num_of_secular_or_ecclesiastical_electors_6
        trigger = {
			calc_true_if = {
				all_elector = {
					is_an_ecclesiastical_country = yes
				}
				amount = 6
			}
        }
    }
	text = {
        localisation_key = string_num_of_secular_or_ecclesiastical_electors_5
        trigger = {
			calc_true_if = {
				all_elector = {
					is_an_ecclesiastical_country = yes
				}
				amount = 5
			}
        }
    }
	text = {
        localisation_key = string_num_of_secular_or_ecclesiastical_electors_4
        trigger = {
			calc_true_if = {
				all_elector = {
					is_an_ecclesiastical_country = yes
				}
				amount = 4
			}
        }
    }
	text = {
        localisation_key = string_num_of_secular_or_ecclesiastical_electors_3
        trigger = {
			calc_true_if = {
				all_elector = {
					is_an_ecclesiastical_country = yes
				}
				amount = 3
			}
        }
    }
	text = {
        localisation_key = string_num_of_secular_or_ecclesiastical_electors_2
        trigger = {
			calc_true_if = {
				all_elector = {
					is_an_ecclesiastical_country = yes
				}
				amount = 2
			}
        }
    }
	text = {
        localisation_key = string_num_of_secular_or_ecclesiastical_electors_1
        trigger = {
			calc_true_if = {
				all_elector = {
					is_an_ecclesiastical_country = yes
				}
				amount = 1
			}
        }
    }
	text = {
        localisation_key = string_num_of_secular_or_ecclesiastical_electors_0
        trigger = {
			always = yes
        }
    }
}

defined_text = {
    name = GetReducedAmoutOfIABecauseOfGoldenBull
	random = no

    text = {
        localisation_key = string_reduced_amount_of_ia_because_of_golden_bull_7
        trigger = {
			variable_arithmetic_trigger = {
				export_to_variable = {
					which = num_of_secular_electors
					value = 0
				}
				export_to_variable = {
					which = num_of_ecclesiastical_electors
					value = 0
				}
				export_to_variable = {
					which = num_of_total_electors_over_limit
					value = 0
				}

				if = {
					limit = {
						OR = {
							AND = {
								is_elector = yes
								is_a_secular_country = yes
							}
							any_elector = {
								is_a_secular_country = yes
							}
						}
					}
					variable_arithmetic_trigger = {
						change_variable = { which = num_of_secular_electors value = 1 }
					}
				}
				if = {
					limit = {
						calc_true_if = {
							all_elector = {
								is_a_secular_country = yes
							}
							amount = 2
						}
					}
					variable_arithmetic_trigger = {
						change_variable = { which = num_of_secular_electors value = 1 }
					}
				}
				if = {
					limit = {
						calc_true_if = {
							all_elector = {
								is_a_secular_country = yes
							}
							amount = 3
						}
					}
					variable_arithmetic_trigger = {
						change_variable = { which = num_of_secular_electors value = 1 }
					}
				}
				if = {
					limit = {
						calc_true_if = {
							all_elector = {
								is_a_secular_country = yes
							}
							amount = 4
						}
					}
					variable_arithmetic_trigger = {
						change_variable = { which = num_of_secular_electors value = 1 }
					}
				}
				if = {
					limit = {
						calc_true_if = {
							all_elector = {
								is_a_secular_country = yes
							}
							amount = 5
						}
					}
					variable_arithmetic_trigger = {
						change_variable = { which = num_of_secular_electors value = 1 }
					}
				}
				if = {
					limit = {
						calc_true_if = {
							all_elector = {
								is_a_secular_country = yes
							}
							amount = 6
						}
					}
					variable_arithmetic_trigger = {
						change_variable = { which = num_of_secular_electors value = 1 }
					}
				}
				if = {
					limit = {
						calc_true_if = {
							all_elector = {
								is_a_secular_country = yes
							}
							amount = 7
						}
					}
					variable_arithmetic_trigger = {
						change_variable = { which = num_of_secular_electors value = 1 }
					}
				}
				if = {
					limit = {
						calc_true_if = {
							all_elector = {
								is_a_secular_country = yes
							}
							amount = 8
						}
					}
					variable_arithmetic_trigger = {
						change_variable = { which = num_of_secular_electors value = 1 }
					}
				}
				if = {
					limit = {
						calc_true_if = {
							all_elector = {
								is_a_secular_country = yes
							}
							amount = 9
						}
					}
					variable_arithmetic_trigger = {
						change_variable = { which = num_of_secular_electors value = 1 }
					}
				}
				if = {
					limit = {
						calc_true_if = {
							all_elector = {
								is_a_secular_country = yes
							}
							amount = 10
						}
					}
					variable_arithmetic_trigger = {
						change_variable = { which = num_of_secular_electors value = 1 }
					}
				}

				if = {
					limit = {
						OR = {
							AND = {
								is_elector = yes
								is_an_ecclesiastical_country = yes
							}
							any_elector = {
								is_an_ecclesiastical_country = yes
							}
						}
					}
					variable_arithmetic_trigger = {
						change_variable = { which = num_of_ecclesiastical_electors value = 1 }
					}
				}
				if = {
					limit = {
						calc_true_if = {
							all_elector = {
								is_an_ecclesiastical_country = yes
							}
							amount = 2
						}
					}
					variable_arithmetic_trigger = {
						change_variable = { which = num_of_ecclesiastical_electors value = 1 }
					}
				}
				if = {
					limit = {
						calc_true_if = {
							all_elector = {
								is_an_ecclesiastical_country = yes
							}
							amount = 3
						}
					}
					variable_arithmetic_trigger = {
						change_variable = { which = num_of_ecclesiastical_electors value = 1 }
					}
				}
				if = {
					limit = {
						calc_true_if = {
							all_elector = {
								is_an_ecclesiastical_country = yes
							}
							amount = 4
						}
					}
					variable_arithmetic_trigger = {
						change_variable = { which = num_of_ecclesiastical_electors value = 1 }
					}
				}
				if = {
					limit = {
						calc_true_if = {
							all_elector = {
								is_an_ecclesiastical_country = yes
							}
							amount = 5
						}
					}
					variable_arithmetic_trigger = {
						change_variable = { which = num_of_ecclesiastical_electors value = 1 }
					}
				}
				if = {
					limit = {
						calc_true_if = {
							all_elector = {
								is_an_ecclesiastical_country = yes
							}
							amount = 6
						}
					}
					variable_arithmetic_trigger = {
						change_variable = { which = num_of_ecclesiastical_electors value = 1 }
					}
				}
				if = {
					limit = {
						calc_true_if = {
							all_elector = {
								is_an_ecclesiastical_country = yes
							}
							amount = 7
						}
					}
					variable_arithmetic_trigger = {
						change_variable = { which = num_of_ecclesiastical_electors value = 1 }
					}
				}
				if = {
					limit = {
						calc_true_if = {
							all_elector = {
								is_an_ecclesiastical_country = yes
							}
							amount = 8
						}
					}
					variable_arithmetic_trigger = {
						change_variable = { which = num_of_ecclesiastical_electors value = 1 }
					}
				}
				if = {
					limit = {
						calc_true_if = {
							all_elector = {
								is_an_ecclesiastical_country = yes
							}
							amount = 9
						}
					}
					variable_arithmetic_trigger = {
						change_variable = { which = num_of_ecclesiastical_electors value = 1 }
					}
				}
				if = {
					limit = {
						calc_true_if = {
							all_elector = {
								is_an_ecclesiastical_country = yes
							}
							amount = 10
						}
					}
					variable_arithmetic_trigger = {
						change_variable = { which = num_of_ecclesiastical_electors value = 1 }
					}
				}

				if = {
					limit = {
						num_of_max_electors = { value = 8 }
					}
					variable_arithmetic_trigger = {
						change_variable = { which = num_of_ecclesiastical_electors value = -4 }
					}
				}
				else = {
					variable_arithmetic_trigger = {
						change_variable = { which = num_of_ecclesiastical_electors value = -3 }
					}
				}
				variable_arithmetic_trigger = {
					change_variable = { which = num_of_secular_electors value = -4 }
				}
				if = {
					limit = {
						check_variable = { which = num_of_secular_electors value = 0 }
					}
					variable_arithmetic_trigger = {
						change_variable = { which = num_of_total_electors_over_limit which = num_of_secular_electors }
					}
				}
				if = {
					limit = {
						check_variable = { which = num_of_ecclesiastical_electors value = 0 }
					}
					variable_arithmetic_trigger = {
						change_variable = { which = num_of_total_electors_over_limit which = num_of_ecclesiastical_electors }
					}
				}

				check_variable = { which = num_of_total_electors_over_limit value = 7 }
			}
        }
    }
	text = {
        localisation_key = string_reduced_amount_of_ia_because_of_golden_bull_6
        trigger = {
			variable_arithmetic_trigger = {
				export_to_variable = {
					which = num_of_secular_electors
					value = 0
				}
				export_to_variable = {
					which = num_of_ecclesiastical_electors
					value = 0
				}
				export_to_variable = {
					which = num_of_total_electors_over_limit
					value = 0
				}

				if = {
					limit = {
						OR = {
							AND = {
								is_elector = yes
								is_a_secular_country = yes
							}
							any_elector = {
								is_a_secular_country = yes
							}
						}
					}
					variable_arithmetic_trigger = {
						change_variable = { which = num_of_secular_electors value = 1 }
					}
				}
				if = {
					limit = {
						calc_true_if = {
							all_elector = {
								is_a_secular_country = yes
							}
							amount = 2
						}
					}
					variable_arithmetic_trigger = {
						change_variable = { which = num_of_secular_electors value = 1 }
					}
				}
				if = {
					limit = {
						calc_true_if = {
							all_elector = {
								is_a_secular_country = yes
							}
							amount = 3
						}
					}
					variable_arithmetic_trigger = {
						change_variable = { which = num_of_secular_electors value = 1 }
					}
				}
				if = {
					limit = {
						calc_true_if = {
							all_elector = {
								is_a_secular_country = yes
							}
							amount = 4
						}
					}
					variable_arithmetic_trigger = {
						change_variable = { which = num_of_secular_electors value = 1 }
					}
				}
				if = {
					limit = {
						calc_true_if = {
							all_elector = {
								is_a_secular_country = yes
							}
							amount = 5
						}
					}
					variable_arithmetic_trigger = {
						change_variable = { which = num_of_secular_electors value = 1 }
					}
				}
				if = {
					limit = {
						calc_true_if = {
							all_elector = {
								is_a_secular_country = yes
							}
							amount = 6
						}
					}
					variable_arithmetic_trigger = {
						change_variable = { which = num_of_secular_electors value = 1 }
					}
				}
				if = {
					limit = {
						calc_true_if = {
							all_elector = {
								is_a_secular_country = yes
							}
							amount = 7
						}
					}
					variable_arithmetic_trigger = {
						change_variable = { which = num_of_secular_electors value = 1 }
					}
				}
				if = {
					limit = {
						calc_true_if = {
							all_elector = {
								is_a_secular_country = yes
							}
							amount = 8
						}
					}
					variable_arithmetic_trigger = {
						change_variable = { which = num_of_secular_electors value = 1 }
					}
				}
				if = {
					limit = {
						calc_true_if = {
							all_elector = {
								is_a_secular_country = yes
							}
							amount = 9
						}
					}
					variable_arithmetic_trigger = {
						change_variable = { which = num_of_secular_electors value = 1 }
					}
				}
				if = {
					limit = {
						calc_true_if = {
							all_elector = {
								is_a_secular_country = yes
							}
							amount = 10
						}
					}
					variable_arithmetic_trigger = {
						change_variable = { which = num_of_secular_electors value = 1 }
					}
				}

				if = {
					limit = {
						OR = {
							AND = {
								is_elector = yes
								is_an_ecclesiastical_country = yes
							}
							any_elector = {
								is_an_ecclesiastical_country = yes
							}
						}
					}
					variable_arithmetic_trigger = {
						change_variable = { which = num_of_ecclesiastical_electors value = 1 }
					}
				}
				if = {
					limit = {
						calc_true_if = {
							all_elector = {
								is_an_ecclesiastical_country = yes
							}
							amount = 2
						}
					}
					variable_arithmetic_trigger = {
						change_variable = { which = num_of_ecclesiastical_electors value = 1 }
					}
				}
				if = {
					limit = {
						calc_true_if = {
							all_elector = {
								is_an_ecclesiastical_country = yes
							}
							amount = 3
						}
					}
					variable_arithmetic_trigger = {
						change_variable = { which = num_of_ecclesiastical_electors value = 1 }
					}
				}
				if = {
					limit = {
						calc_true_if = {
							all_elector = {
								is_an_ecclesiastical_country = yes
							}
							amount = 4
						}
					}
					variable_arithmetic_trigger = {
						change_variable = { which = num_of_ecclesiastical_electors value = 1 }
					}
				}
				if = {
					limit = {
						calc_true_if = {
							all_elector = {
								is_an_ecclesiastical_country = yes
							}
							amount = 5
						}
					}
					variable_arithmetic_trigger = {
						change_variable = { which = num_of_ecclesiastical_electors value = 1 }
					}
				}
				if = {
					limit = {
						calc_true_if = {
							all_elector = {
								is_an_ecclesiastical_country = yes
							}
							amount = 6
						}
					}
					variable_arithmetic_trigger = {
						change_variable = { which = num_of_ecclesiastical_electors value = 1 }
					}
				}
				if = {
					limit = {
						calc_true_if = {
							all_elector = {
								is_an_ecclesiastical_country = yes
							}
							amount = 7
						}
					}
					variable_arithmetic_trigger = {
						change_variable = { which = num_of_ecclesiastical_electors value = 1 }
					}
				}
				if = {
					limit = {
						calc_true_if = {
							all_elector = {
								is_an_ecclesiastical_country = yes
							}
							amount = 8
						}
					}
					variable_arithmetic_trigger = {
						change_variable = { which = num_of_ecclesiastical_electors value = 1 }
					}
				}
				if = {
					limit = {
						calc_true_if = {
							all_elector = {
								is_an_ecclesiastical_country = yes
							}
							amount = 9
						}
					}
					variable_arithmetic_trigger = {
						change_variable = { which = num_of_ecclesiastical_electors value = 1 }
					}
				}
				if = {
					limit = {
						calc_true_if = {
							all_elector = {
								is_an_ecclesiastical_country = yes
							}
							amount = 10
						}
					}
					variable_arithmetic_trigger = {
						change_variable = { which = num_of_ecclesiastical_electors value = 1 }
					}
				}

				if = {
					limit = {
						num_of_max_electors = { value = 8 }
					}
					variable_arithmetic_trigger = {
						change_variable = { which = num_of_ecclesiastical_electors value = -4 }
					}
				}
				else = {
					variable_arithmetic_trigger = {
						change_variable = { which = num_of_ecclesiastical_electors value = -3 }
					}
				}
				variable_arithmetic_trigger = {
					change_variable = { which = num_of_secular_electors value = -4 }
				}
				if = {
					limit = {
						check_variable = { which = num_of_secular_electors value = 0 }
					}
					variable_arithmetic_trigger = {
						change_variable = { which = num_of_total_electors_over_limit which = num_of_secular_electors }
					}
				}
				if = {
					limit = {
						check_variable = { which = num_of_ecclesiastical_electors value = 0 }
					}
					variable_arithmetic_trigger = {
						change_variable = { which = num_of_total_electors_over_limit which = num_of_ecclesiastical_electors }
					}
				}

				check_variable = { which = num_of_total_electors_over_limit value = 6 }
			}
        }
    }
	text = {
        localisation_key = string_reduced_amount_of_ia_because_of_golden_bull_5
        trigger = {
			variable_arithmetic_trigger = {
				export_to_variable = {
					which = num_of_secular_electors
					value = 0
				}
				export_to_variable = {
					which = num_of_ecclesiastical_electors
					value = 0
				}
				export_to_variable = {
					which = num_of_total_electors_over_limit
					value = 0
				}

				if = {
					limit = {
						OR = {
							AND = {
								is_elector = yes
								is_a_secular_country = yes
							}
							any_elector = {
								is_a_secular_country = yes
							}
						}
					}
					variable_arithmetic_trigger = {
						change_variable = { which = num_of_secular_electors value = 1 }
					}
				}
				if = {
					limit = {
						calc_true_if = {
							all_elector = {
								is_a_secular_country = yes
							}
							amount = 2
						}
					}
					variable_arithmetic_trigger = {
						change_variable = { which = num_of_secular_electors value = 1 }
					}
				}
				if = {
					limit = {
						calc_true_if = {
							all_elector = {
								is_a_secular_country = yes
							}
							amount = 3
						}
					}
					variable_arithmetic_trigger = {
						change_variable = { which = num_of_secular_electors value = 1 }
					}
				}
				if = {
					limit = {
						calc_true_if = {
							all_elector = {
								is_a_secular_country = yes
							}
							amount = 4
						}
					}
					variable_arithmetic_trigger = {
						change_variable = { which = num_of_secular_electors value = 1 }
					}
				}
				if = {
					limit = {
						calc_true_if = {
							all_elector = {
								is_a_secular_country = yes
							}
							amount = 5
						}
					}
					variable_arithmetic_trigger = {
						change_variable = { which = num_of_secular_electors value = 1 }
					}
				}
				if = {
					limit = {
						calc_true_if = {
							all_elector = {
								is_a_secular_country = yes
							}
							amount = 6
						}
					}
					variable_arithmetic_trigger = {
						change_variable = { which = num_of_secular_electors value = 1 }
					}
				}
				if = {
					limit = {
						calc_true_if = {
							all_elector = {
								is_a_secular_country = yes
							}
							amount = 7
						}
					}
					variable_arithmetic_trigger = {
						change_variable = { which = num_of_secular_electors value = 1 }
					}
				}
				if = {
					limit = {
						calc_true_if = {
							all_elector = {
								is_a_secular_country = yes
							}
							amount = 8
						}
					}
					variable_arithmetic_trigger = {
						change_variable = { which = num_of_secular_electors value = 1 }
					}
				}
				if = {
					limit = {
						calc_true_if = {
							all_elector = {
								is_a_secular_country = yes
							}
							amount = 9
						}
					}
					variable_arithmetic_trigger = {
						change_variable = { which = num_of_secular_electors value = 1 }
					}
				}
				if = {
					limit = {
						calc_true_if = {
							all_elector = {
								is_a_secular_country = yes
							}
							amount = 10
						}
					}
					variable_arithmetic_trigger = {
						change_variable = { which = num_of_secular_electors value = 1 }
					}
				}

				if = {
					limit = {
						OR = {
							AND = {
								is_elector = yes
								is_an_ecclesiastical_country = yes
							}
							any_elector = {
								is_an_ecclesiastical_country = yes
							}
						}
					}
					variable_arithmetic_trigger = {
						change_variable = { which = num_of_ecclesiastical_electors value = 1 }
					}
				}
				if = {
					limit = {
						calc_true_if = {
							all_elector = {
								is_an_ecclesiastical_country = yes
							}
							amount = 2
						}
					}
					variable_arithmetic_trigger = {
						change_variable = { which = num_of_ecclesiastical_electors value = 1 }
					}
				}
				if = {
					limit = {
						calc_true_if = {
							all_elector = {
								is_an_ecclesiastical_country = yes
							}
							amount = 3
						}
					}
					variable_arithmetic_trigger = {
						change_variable = { which = num_of_ecclesiastical_electors value = 1 }
					}
				}
				if = {
					limit = {
						calc_true_if = {
							all_elector = {
								is_an_ecclesiastical_country = yes
							}
							amount = 4
						}
					}
					variable_arithmetic_trigger = {
						change_variable = { which = num_of_ecclesiastical_electors value = 1 }
					}
				}
				if = {
					limit = {
						calc_true_if = {
							all_elector = {
								is_an_ecclesiastical_country = yes
							}
							amount = 5
						}
					}
					variable_arithmetic_trigger = {
						change_variable = { which = num_of_ecclesiastical_electors value = 1 }
					}
				}
				if = {
					limit = {
						calc_true_if = {
							all_elector = {
								is_an_ecclesiastical_country = yes
							}
							amount = 6
						}
					}
					variable_arithmetic_trigger = {
						change_variable = { which = num_of_ecclesiastical_electors value = 1 }
					}
				}
				if = {
					limit = {
						calc_true_if = {
							all_elector = {
								is_an_ecclesiastical_country = yes
							}
							amount = 7
						}
					}
					variable_arithmetic_trigger = {
						change_variable = { which = num_of_ecclesiastical_electors value = 1 }
					}
				}
				if = {
					limit = {
						calc_true_if = {
							all_elector = {
								is_an_ecclesiastical_country = yes
							}
							amount = 8
						}
					}
					variable_arithmetic_trigger = {
						change_variable = { which = num_of_ecclesiastical_electors value = 1 }
					}
				}
				if = {
					limit = {
						calc_true_if = {
							all_elector = {
								is_an_ecclesiastical_country = yes
							}
							amount = 9
						}
					}
					variable_arithmetic_trigger = {
						change_variable = { which = num_of_ecclesiastical_electors value = 1 }
					}
				}
				if = {
					limit = {
						calc_true_if = {
							all_elector = {
								is_an_ecclesiastical_country = yes
							}
							amount = 10
						}
					}
					variable_arithmetic_trigger = {
						change_variable = { which = num_of_ecclesiastical_electors value = 1 }
					}
				}

				if = {
					limit = {
						num_of_max_electors = { value = 8 }
					}
					variable_arithmetic_trigger = {
						change_variable = { which = num_of_ecclesiastical_electors value = -4 }
					}
				}
				else = {
					variable_arithmetic_trigger = {
						change_variable = { which = num_of_ecclesiastical_electors value = -3 }
					}
				}
				variable_arithmetic_trigger = {
					change_variable = { which = num_of_secular_electors value = -4 }
				}
				if = {
					limit = {
						check_variable = { which = num_of_secular_electors value = 0 }
					}
					variable_arithmetic_trigger = {
						change_variable = { which = num_of_total_electors_over_limit which = num_of_secular_electors }
					}
				}
				if = {
					limit = {
						check_variable = { which = num_of_ecclesiastical_electors value = 0 }
					}
					variable_arithmetic_trigger = {
						change_variable = { which = num_of_total_electors_over_limit which = num_of_ecclesiastical_electors }
					}
				}

				check_variable = { which = num_of_total_electors_over_limit value = 5 }
			}
        }
    }
	text = {
        localisation_key = string_reduced_amount_of_ia_because_of_golden_bull_4
        trigger = {
			variable_arithmetic_trigger = {
				export_to_variable = {
					which = num_of_secular_electors
					value = 0
				}
				export_to_variable = {
					which = num_of_ecclesiastical_electors
					value = 0
				}
				export_to_variable = {
					which = num_of_total_electors_over_limit
					value = 0
				}

				if = {
					limit = {
						OR = {
							AND = {
								is_elector = yes
								is_a_secular_country = yes
							}
							any_elector = {
								is_a_secular_country = yes
							}
						}
					}
					variable_arithmetic_trigger = {
						change_variable = { which = num_of_secular_electors value = 1 }
					}
				}
				if = {
					limit = {
						calc_true_if = {
							all_elector = {
								is_a_secular_country = yes
							}
							amount = 2
						}
					}
					variable_arithmetic_trigger = {
						change_variable = { which = num_of_secular_electors value = 1 }
					}
				}
				if = {
					limit = {
						calc_true_if = {
							all_elector = {
								is_a_secular_country = yes
							}
							amount = 3
						}
					}
					variable_arithmetic_trigger = {
						change_variable = { which = num_of_secular_electors value = 1 }
					}
				}
				if = {
					limit = {
						calc_true_if = {
							all_elector = {
								is_a_secular_country = yes
							}
							amount = 4
						}
					}
					variable_arithmetic_trigger = {
						change_variable = { which = num_of_secular_electors value = 1 }
					}
				}
				if = {
					limit = {
						calc_true_if = {
							all_elector = {
								is_a_secular_country = yes
							}
							amount = 5
						}
					}
					variable_arithmetic_trigger = {
						change_variable = { which = num_of_secular_electors value = 1 }
					}
				}
				if = {
					limit = {
						calc_true_if = {
							all_elector = {
								is_a_secular_country = yes
							}
							amount = 6
						}
					}
					variable_arithmetic_trigger = {
						change_variable = { which = num_of_secular_electors value = 1 }
					}
				}
				if = {
					limit = {
						calc_true_if = {
							all_elector = {
								is_a_secular_country = yes
							}
							amount = 7
						}
					}
					variable_arithmetic_trigger = {
						change_variable = { which = num_of_secular_electors value = 1 }
					}
				}
				if = {
					limit = {
						calc_true_if = {
							all_elector = {
								is_a_secular_country = yes
							}
							amount = 8
						}
					}
					variable_arithmetic_trigger = {
						change_variable = { which = num_of_secular_electors value = 1 }
					}
				}
				if = {
					limit = {
						calc_true_if = {
							all_elector = {
								is_a_secular_country = yes
							}
							amount = 9
						}
					}
					variable_arithmetic_trigger = {
						change_variable = { which = num_of_secular_electors value = 1 }
					}
				}
				if = {
					limit = {
						calc_true_if = {
							all_elector = {
								is_a_secular_country = yes
							}
							amount = 10
						}
					}
					variable_arithmetic_trigger = {
						change_variable = { which = num_of_secular_electors value = 1 }
					}
				}

				if = {
					limit = {
						OR = {
							AND = {
								is_elector = yes
								is_an_ecclesiastical_country = yes
							}
							any_elector = {
								is_an_ecclesiastical_country = yes
							}
						}
					}
					variable_arithmetic_trigger = {
						change_variable = { which = num_of_ecclesiastical_electors value = 1 }
					}
				}
				if = {
					limit = {
						calc_true_if = {
							all_elector = {
								is_an_ecclesiastical_country = yes
							}
							amount = 2
						}
					}
					variable_arithmetic_trigger = {
						change_variable = { which = num_of_ecclesiastical_electors value = 1 }
					}
				}
				if = {
					limit = {
						calc_true_if = {
							all_elector = {
								is_an_ecclesiastical_country = yes
							}
							amount = 3
						}
					}
					variable_arithmetic_trigger = {
						change_variable = { which = num_of_ecclesiastical_electors value = 1 }
					}
				}
				if = {
					limit = {
						calc_true_if = {
							all_elector = {
								is_an_ecclesiastical_country = yes
							}
							amount = 4
						}
					}
					variable_arithmetic_trigger = {
						change_variable = { which = num_of_ecclesiastical_electors value = 1 }
					}
				}
				if = {
					limit = {
						calc_true_if = {
							all_elector = {
								is_an_ecclesiastical_country = yes
							}
							amount = 5
						}
					}
					variable_arithmetic_trigger = {
						change_variable = { which = num_of_ecclesiastical_electors value = 1 }
					}
				}
				if = {
					limit = {
						calc_true_if = {
							all_elector = {
								is_an_ecclesiastical_country = yes
							}
							amount = 6
						}
					}
					variable_arithmetic_trigger = {
						change_variable = { which = num_of_ecclesiastical_electors value = 1 }
					}
				}
				if = {
					limit = {
						calc_true_if = {
							all_elector = {
								is_an_ecclesiastical_country = yes
							}
							amount = 7
						}
					}
					variable_arithmetic_trigger = {
						change_variable = { which = num_of_ecclesiastical_electors value = 1 }
					}
				}
				if = {
					limit = {
						calc_true_if = {
							all_elector = {
								is_an_ecclesiastical_country = yes
							}
							amount = 8
						}
					}
					variable_arithmetic_trigger = {
						change_variable = { which = num_of_ecclesiastical_electors value = 1 }
					}
				}
				if = {
					limit = {
						calc_true_if = {
							all_elector = {
								is_an_ecclesiastical_country = yes
							}
							amount = 9
						}
					}
					variable_arithmetic_trigger = {
						change_variable = { which = num_of_ecclesiastical_electors value = 1 }
					}
				}
				if = {
					limit = {
						calc_true_if = {
							all_elector = {
								is_an_ecclesiastical_country = yes
							}
							amount = 10
						}
					}
					variable_arithmetic_trigger = {
						change_variable = { which = num_of_ecclesiastical_electors value = 1 }
					}
				}

				if = {
					limit = {
						num_of_max_electors = { value = 8 }
					}
					variable_arithmetic_trigger = {
						change_variable = { which = num_of_ecclesiastical_electors value = -4 }
					}
				}
				else = {
					variable_arithmetic_trigger = {
						change_variable = { which = num_of_ecclesiastical_electors value = -3 }
					}
				}
				variable_arithmetic_trigger = {
					change_variable = { which = num_of_secular_electors value = -4 }
				}
				if = {
					limit = {
						check_variable = { which = num_of_secular_electors value = 0 }
					}
					variable_arithmetic_trigger = {
						change_variable = { which = num_of_total_electors_over_limit which = num_of_secular_electors }
					}
				}
				if = {
					limit = {
						check_variable = { which = num_of_ecclesiastical_electors value = 0 }
					}
					variable_arithmetic_trigger = {
						change_variable = { which = num_of_total_electors_over_limit which = num_of_ecclesiastical_electors }
					}
				}

				check_variable = { which = num_of_total_electors_over_limit value = 4 }
			}
        }
    }
	text = {
        localisation_key = string_reduced_amount_of_ia_because_of_golden_bull_3
        trigger = {
			variable_arithmetic_trigger = {
				export_to_variable = {
					which = num_of_secular_electors
					value = 0
				}
				export_to_variable = {
					which = num_of_ecclesiastical_electors
					value = 0
				}
				export_to_variable = {
					which = num_of_total_electors_over_limit
					value = 0
				}

				if = {
					limit = {
						OR = {
							AND = {
								is_elector = yes
								is_a_secular_country = yes
							}
							any_elector = {
								is_a_secular_country = yes
							}
						}
					}
					variable_arithmetic_trigger = {
						change_variable = { which = num_of_secular_electors value = 1 }
					}
				}
				if = {
					limit = {
						calc_true_if = {
							all_elector = {
								is_a_secular_country = yes
							}
							amount = 2
						}
					}
					variable_arithmetic_trigger = {
						change_variable = { which = num_of_secular_electors value = 1 }
					}
				}
				if = {
					limit = {
						calc_true_if = {
							all_elector = {
								is_a_secular_country = yes
							}
							amount = 3
						}
					}
					variable_arithmetic_trigger = {
						change_variable = { which = num_of_secular_electors value = 1 }
					}
				}
				if = {
					limit = {
						calc_true_if = {
							all_elector = {
								is_a_secular_country = yes
							}
							amount = 4
						}
					}
					variable_arithmetic_trigger = {
						change_variable = { which = num_of_secular_electors value = 1 }
					}
				}
				if = {
					limit = {
						calc_true_if = {
							all_elector = {
								is_a_secular_country = yes
							}
							amount = 5
						}
					}
					variable_arithmetic_trigger = {
						change_variable = { which = num_of_secular_electors value = 1 }
					}
				}
				if = {
					limit = {
						calc_true_if = {
							all_elector = {
								is_a_secular_country = yes
							}
							amount = 6
						}
					}
					variable_arithmetic_trigger = {
						change_variable = { which = num_of_secular_electors value = 1 }
					}
				}
				if = {
					limit = {
						calc_true_if = {
							all_elector = {
								is_a_secular_country = yes
							}
							amount = 7
						}
					}
					variable_arithmetic_trigger = {
						change_variable = { which = num_of_secular_electors value = 1 }
					}
				}
				if = {
					limit = {
						calc_true_if = {
							all_elector = {
								is_a_secular_country = yes
							}
							amount = 8
						}
					}
					variable_arithmetic_trigger = {
						change_variable = { which = num_of_secular_electors value = 1 }
					}
				}
				if = {
					limit = {
						calc_true_if = {
							all_elector = {
								is_a_secular_country = yes
							}
							amount = 9
						}
					}
					variable_arithmetic_trigger = {
						change_variable = { which = num_of_secular_electors value = 1 }
					}
				}
				if = {
					limit = {
						calc_true_if = {
							all_elector = {
								is_a_secular_country = yes
							}
							amount = 10
						}
					}
					variable_arithmetic_trigger = {
						change_variable = { which = num_of_secular_electors value = 1 }
					}
				}

				if = {
					limit = {
						OR = {
							AND = {
								is_elector = yes
								is_an_ecclesiastical_country = yes
							}
							any_elector = {
								is_an_ecclesiastical_country = yes
							}
						}
					}
					variable_arithmetic_trigger = {
						change_variable = { which = num_of_ecclesiastical_electors value = 1 }
					}
				}
				if = {
					limit = {
						calc_true_if = {
							all_elector = {
								is_an_ecclesiastical_country = yes
							}
							amount = 2
						}
					}
					variable_arithmetic_trigger = {
						change_variable = { which = num_of_ecclesiastical_electors value = 1 }
					}
				}
				if = {
					limit = {
						calc_true_if = {
							all_elector = {
								is_an_ecclesiastical_country = yes
							}
							amount = 3
						}
					}
					variable_arithmetic_trigger = {
						change_variable = { which = num_of_ecclesiastical_electors value = 1 }
					}
				}
				if = {
					limit = {
						calc_true_if = {
							all_elector = {
								is_an_ecclesiastical_country = yes
							}
							amount = 4
						}
					}
					variable_arithmetic_trigger = {
						change_variable = { which = num_of_ecclesiastical_electors value = 1 }
					}
				}
				if = {
					limit = {
						calc_true_if = {
							all_elector = {
								is_an_ecclesiastical_country = yes
							}
							amount = 5
						}
					}
					variable_arithmetic_trigger = {
						change_variable = { which = num_of_ecclesiastical_electors value = 1 }
					}
				}
				if = {
					limit = {
						calc_true_if = {
							all_elector = {
								is_an_ecclesiastical_country = yes
							}
							amount = 6
						}
					}
					variable_arithmetic_trigger = {
						change_variable = { which = num_of_ecclesiastical_electors value = 1 }
					}
				}
				if = {
					limit = {
						calc_true_if = {
							all_elector = {
								is_an_ecclesiastical_country = yes
							}
							amount = 7
						}
					}
					variable_arithmetic_trigger = {
						change_variable = { which = num_of_ecclesiastical_electors value = 1 }
					}
				}
				if = {
					limit = {
						calc_true_if = {
							all_elector = {
								is_an_ecclesiastical_country = yes
							}
							amount = 8
						}
					}
					variable_arithmetic_trigger = {
						change_variable = { which = num_of_ecclesiastical_electors value = 1 }
					}
				}
				if = {
					limit = {
						calc_true_if = {
							all_elector = {
								is_an_ecclesiastical_country = yes
							}
							amount = 9
						}
					}
					variable_arithmetic_trigger = {
						change_variable = { which = num_of_ecclesiastical_electors value = 1 }
					}
				}
				if = {
					limit = {
						calc_true_if = {
							all_elector = {
								is_an_ecclesiastical_country = yes
							}
							amount = 10
						}
					}
					variable_arithmetic_trigger = {
						change_variable = { which = num_of_ecclesiastical_electors value = 1 }
					}
				}

				if = {
					limit = {
						num_of_max_electors = { value = 8 }
					}
					variable_arithmetic_trigger = {
						change_variable = { which = num_of_ecclesiastical_electors value = -4 }
					}
				}
				else = {
					variable_arithmetic_trigger = {
						change_variable = { which = num_of_ecclesiastical_electors value = -3 }
					}
				}
				variable_arithmetic_trigger = {
					change_variable = { which = num_of_secular_electors value = -4 }
				}
				if = {
					limit = {
						check_variable = { which = num_of_secular_electors value = 0 }
					}
					variable_arithmetic_trigger = {
						change_variable = { which = num_of_total_electors_over_limit which = num_of_secular_electors }
					}
				}
				if = {
					limit = {
						check_variable = { which = num_of_ecclesiastical_electors value = 0 }
					}
					variable_arithmetic_trigger = {
						change_variable = { which = num_of_total_electors_over_limit which = num_of_ecclesiastical_electors }
					}
				}

				check_variable = { which = num_of_total_electors_over_limit value = 3 }
			}
        }
    }
	text = {
        localisation_key = string_reduced_amount_of_ia_because_of_golden_bull_2
        trigger = {
			variable_arithmetic_trigger = {
				export_to_variable = {
					which = num_of_secular_electors
					value = 0
				}
				export_to_variable = {
					which = num_of_ecclesiastical_electors
					value = 0
				}
				export_to_variable = {
					which = num_of_total_electors_over_limit
					value = 0
				}

				if = {
					limit = {
						OR = {
							AND = {
								is_elector = yes
								is_a_secular_country = yes
							}
							any_elector = {
								is_a_secular_country = yes
							}
						}
					}
					variable_arithmetic_trigger = {
						change_variable = { which = num_of_secular_electors value = 1 }
					}
				}
				if = {
					limit = {
						calc_true_if = {
							all_elector = {
								is_a_secular_country = yes
							}
							amount = 2
						}
					}
					variable_arithmetic_trigger = {
						change_variable = { which = num_of_secular_electors value = 1 }
					}
				}
				if = {
					limit = {
						calc_true_if = {
							all_elector = {
								is_a_secular_country = yes
							}
							amount = 3
						}
					}
					variable_arithmetic_trigger = {
						change_variable = { which = num_of_secular_electors value = 1 }
					}
				}
				if = {
					limit = {
						calc_true_if = {
							all_elector = {
								is_a_secular_country = yes
							}
							amount = 4
						}
					}
					variable_arithmetic_trigger = {
						change_variable = { which = num_of_secular_electors value = 1 }
					}
				}
				if = {
					limit = {
						calc_true_if = {
							all_elector = {
								is_a_secular_country = yes
							}
							amount = 5
						}
					}
					variable_arithmetic_trigger = {
						change_variable = { which = num_of_secular_electors value = 1 }
					}
				}
				if = {
					limit = {
						calc_true_if = {
							all_elector = {
								is_a_secular_country = yes
							}
							amount = 6
						}
					}
					variable_arithmetic_trigger = {
						change_variable = { which = num_of_secular_electors value = 1 }
					}
				}
				if = {
					limit = {
						calc_true_if = {
							all_elector = {
								is_a_secular_country = yes
							}
							amount = 7
						}
					}
					variable_arithmetic_trigger = {
						change_variable = { which = num_of_secular_electors value = 1 }
					}
				}
				if = {
					limit = {
						calc_true_if = {
							all_elector = {
								is_a_secular_country = yes
							}
							amount = 8
						}
					}
					variable_arithmetic_trigger = {
						change_variable = { which = num_of_secular_electors value = 1 }
					}
				}
				if = {
					limit = {
						calc_true_if = {
							all_elector = {
								is_a_secular_country = yes
							}
							amount = 9
						}
					}
					variable_arithmetic_trigger = {
						change_variable = { which = num_of_secular_electors value = 1 }
					}
				}
				if = {
					limit = {
						calc_true_if = {
							all_elector = {
								is_a_secular_country = yes
							}
							amount = 10
						}
					}
					variable_arithmetic_trigger = {
						change_variable = { which = num_of_secular_electors value = 1 }
					}
				}

				if = {
					limit = {
						OR = {
							AND = {
								is_elector = yes
								is_an_ecclesiastical_country = yes
							}
							any_elector = {
								is_an_ecclesiastical_country = yes
							}
						}
					}
					variable_arithmetic_trigger = {
						change_variable = { which = num_of_ecclesiastical_electors value = 1 }
					}
				}
				if = {
					limit = {
						calc_true_if = {
							all_elector = {
								is_an_ecclesiastical_country = yes
							}
							amount = 2
						}
					}
					variable_arithmetic_trigger = {
						change_variable = { which = num_of_ecclesiastical_electors value = 1 }
					}
				}
				if = {
					limit = {
						calc_true_if = {
							all_elector = {
								is_an_ecclesiastical_country = yes
							}
							amount = 3
						}
					}
					variable_arithmetic_trigger = {
						change_variable = { which = num_of_ecclesiastical_electors value = 1 }
					}
				}
				if = {
					limit = {
						calc_true_if = {
							all_elector = {
								is_an_ecclesiastical_country = yes
							}
							amount = 4
						}
					}
					variable_arithmetic_trigger = {
						change_variable = { which = num_of_ecclesiastical_electors value = 1 }
					}
				}
				if = {
					limit = {
						calc_true_if = {
							all_elector = {
								is_an_ecclesiastical_country = yes
							}
							amount = 5
						}
					}
					variable_arithmetic_trigger = {
						change_variable = { which = num_of_ecclesiastical_electors value = 1 }
					}
				}
				if = {
					limit = {
						calc_true_if = {
							all_elector = {
								is_an_ecclesiastical_country = yes
							}
							amount = 6
						}
					}
					variable_arithmetic_trigger = {
						change_variable = { which = num_of_ecclesiastical_electors value = 1 }
					}
				}
				if = {
					limit = {
						calc_true_if = {
							all_elector = {
								is_an_ecclesiastical_country = yes
							}
							amount = 7
						}
					}
					variable_arithmetic_trigger = {
						change_variable = { which = num_of_ecclesiastical_electors value = 1 }
					}
				}
				if = {
					limit = {
						calc_true_if = {
							all_elector = {
								is_an_ecclesiastical_country = yes
							}
							amount = 8
						}
					}
					variable_arithmetic_trigger = {
						change_variable = { which = num_of_ecclesiastical_electors value = 1 }
					}
				}
				if = {
					limit = {
						calc_true_if = {
							all_elector = {
								is_an_ecclesiastical_country = yes
							}
							amount = 9
						}
					}
					variable_arithmetic_trigger = {
						change_variable = { which = num_of_ecclesiastical_electors value = 1 }
					}
				}
				if = {
					limit = {
						calc_true_if = {
							all_elector = {
								is_an_ecclesiastical_country = yes
							}
							amount = 10
						}
					}
					variable_arithmetic_trigger = {
						change_variable = { which = num_of_ecclesiastical_electors value = 1 }
					}
				}

				if = {
					limit = {
						num_of_max_electors = { value = 8 }
					}
					variable_arithmetic_trigger = {
						change_variable = { which = num_of_ecclesiastical_electors value = -4 }
					}
				}
				else = {
					variable_arithmetic_trigger = {
						change_variable = { which = num_of_ecclesiastical_electors value = -3 }
					}
				}
				variable_arithmetic_trigger = {
					change_variable = { which = num_of_secular_electors value = -4 }
				}
				if = {
					limit = {
						check_variable = { which = num_of_secular_electors value = 0 }
					}
					variable_arithmetic_trigger = {
						change_variable = { which = num_of_total_electors_over_limit which = num_of_secular_electors }
					}
				}
				if = {
					limit = {
						check_variable = { which = num_of_ecclesiastical_electors value = 0 }
					}
					variable_arithmetic_trigger = {
						change_variable = { which = num_of_total_electors_over_limit which = num_of_ecclesiastical_electors }
					}
				}

				check_variable = { which = num_of_total_electors_over_limit value = 2 }
			}
        }
    }
	text = {
        localisation_key = string_reduced_amount_of_ia_because_of_golden_bull_1
        trigger = {
			variable_arithmetic_trigger = {
				export_to_variable = {
					which = num_of_secular_electors
					value = 0
				}
				export_to_variable = {
					which = num_of_ecclesiastical_electors
					value = 0
				}
				export_to_variable = {
					which = num_of_total_electors_over_limit
					value = 0
				}

				if = {
					limit = {
						OR = {
							AND = {
								is_elector = yes
								is_a_secular_country = yes
							}
							any_elector = {
								is_a_secular_country = yes
							}
						}
					}
					variable_arithmetic_trigger = {
						change_variable = { which = num_of_secular_electors value = 1 }
					}
				}
				if = {
					limit = {
						calc_true_if = {
							all_elector = {
								is_a_secular_country = yes
							}
							amount = 2
						}
					}
					variable_arithmetic_trigger = {
						change_variable = { which = num_of_secular_electors value = 1 }
					}
				}
				if = {
					limit = {
						calc_true_if = {
							all_elector = {
								is_a_secular_country = yes
							}
							amount = 3
						}
					}
					variable_arithmetic_trigger = {
						change_variable = { which = num_of_secular_electors value = 1 }
					}
				}
				if = {
					limit = {
						calc_true_if = {
							all_elector = {
								is_a_secular_country = yes
							}
							amount = 4
						}
					}
					variable_arithmetic_trigger = {
						change_variable = { which = num_of_secular_electors value = 1 }
					}
				}
				if = {
					limit = {
						calc_true_if = {
							all_elector = {
								is_a_secular_country = yes
							}
							amount = 5
						}
					}
					variable_arithmetic_trigger = {
						change_variable = { which = num_of_secular_electors value = 1 }
					}
				}
				if = {
					limit = {
						calc_true_if = {
							all_elector = {
								is_a_secular_country = yes
							}
							amount = 6
						}
					}
					variable_arithmetic_trigger = {
						change_variable = { which = num_of_secular_electors value = 1 }
					}
				}
				if = {
					limit = {
						calc_true_if = {
							all_elector = {
								is_a_secular_country = yes
							}
							amount = 7
						}
					}
					variable_arithmetic_trigger = {
						change_variable = { which = num_of_secular_electors value = 1 }
					}
				}
				if = {
					limit = {
						calc_true_if = {
							all_elector = {
								is_a_secular_country = yes
							}
							amount = 8
						}
					}
					variable_arithmetic_trigger = {
						change_variable = { which = num_of_secular_electors value = 1 }
					}
				}
				if = {
					limit = {
						calc_true_if = {
							all_elector = {
								is_a_secular_country = yes
							}
							amount = 9
						}
					}
					variable_arithmetic_trigger = {
						change_variable = { which = num_of_secular_electors value = 1 }
					}
				}
				if = {
					limit = {
						calc_true_if = {
							all_elector = {
								is_a_secular_country = yes
							}
							amount = 10
						}
					}
					variable_arithmetic_trigger = {
						change_variable = { which = num_of_secular_electors value = 1 }
					}
				}

				if = {
					limit = {
						OR = {
							AND = {
								is_elector = yes
								is_an_ecclesiastical_country = yes
							}
							any_elector = {
								is_an_ecclesiastical_country = yes
							}
						}
					}
					variable_arithmetic_trigger = {
						change_variable = { which = num_of_ecclesiastical_electors value = 1 }
					}
				}
				if = {
					limit = {
						calc_true_if = {
							all_elector = {
								is_an_ecclesiastical_country = yes
							}
							amount = 2
						}
					}
					variable_arithmetic_trigger = {
						change_variable = { which = num_of_ecclesiastical_electors value = 1 }
					}
				}
				if = {
					limit = {
						calc_true_if = {
							all_elector = {
								is_an_ecclesiastical_country = yes
							}
							amount = 3
						}
					}
					variable_arithmetic_trigger = {
						change_variable = { which = num_of_ecclesiastical_electors value = 1 }
					}
				}
				if = {
					limit = {
						calc_true_if = {
							all_elector = {
								is_an_ecclesiastical_country = yes
							}
							amount = 4
						}
					}
					variable_arithmetic_trigger = {
						change_variable = { which = num_of_ecclesiastical_electors value = 1 }
					}
				}
				if = {
					limit = {
						calc_true_if = {
							all_elector = {
								is_an_ecclesiastical_country = yes
							}
							amount = 5
						}
					}
					variable_arithmetic_trigger = {
						change_variable = { which = num_of_ecclesiastical_electors value = 1 }
					}
				}
				if = {
					limit = {
						calc_true_if = {
							all_elector = {
								is_an_ecclesiastical_country = yes
							}
							amount = 6
						}
					}
					variable_arithmetic_trigger = {
						change_variable = { which = num_of_ecclesiastical_electors value = 1 }
					}
				}
				if = {
					limit = {
						calc_true_if = {
							all_elector = {
								is_an_ecclesiastical_country = yes
							}
							amount = 7
						}
					}
					variable_arithmetic_trigger = {
						change_variable = { which = num_of_ecclesiastical_electors value = 1 }
					}
				}
				if = {
					limit = {
						calc_true_if = {
							all_elector = {
								is_an_ecclesiastical_country = yes
							}
							amount = 8
						}
					}
					variable_arithmetic_trigger = {
						change_variable = { which = num_of_ecclesiastical_electors value = 1 }
					}
				}
				if = {
					limit = {
						calc_true_if = {
							all_elector = {
								is_an_ecclesiastical_country = yes
							}
							amount = 9
						}
					}
					variable_arithmetic_trigger = {
						change_variable = { which = num_of_ecclesiastical_electors value = 1 }
					}
				}
				if = {
					limit = {
						calc_true_if = {
							all_elector = {
								is_an_ecclesiastical_country = yes
							}
							amount = 10
						}
					}
					variable_arithmetic_trigger = {
						change_variable = { which = num_of_ecclesiastical_electors value = 1 }
					}
				}

				if = {
					limit = {
						num_of_max_electors = { value = 8 }
					}
					variable_arithmetic_trigger = {
						change_variable = { which = num_of_ecclesiastical_electors value = -4 }
					}
				}
				else = {
					variable_arithmetic_trigger = {
						change_variable = { which = num_of_ecclesiastical_electors value = -3 }
					}
				}
				variable_arithmetic_trigger = {
					change_variable = { which = num_of_secular_electors value = -4 }
				}
				if = {
					limit = {
						check_variable = { which = num_of_secular_electors value = 0 }
					}
					variable_arithmetic_trigger = {
						change_variable = { which = num_of_total_electors_over_limit which = num_of_secular_electors }
					}
				}
				if = {
					limit = {
						check_variable = { which = num_of_ecclesiastical_electors value = 0 }
					}
					variable_arithmetic_trigger = {
						change_variable = { which = num_of_total_electors_over_limit which = num_of_ecclesiastical_electors }
					}
				}

				check_variable = { which = num_of_total_electors_over_limit value = 1 }
			}
        }
    }
	text = {
        localisation_key = string_reduced_amount_of_ia_because_of_golden_bull_0
        trigger = {
			always = yes
		}
    }
}

defined_text = {
    name = GetEcclesiasticalElectorsGreenRed
	random = no

    text = {
        localisation_key = string_num_of_secular_or_ecclesiastical_electors_red
        trigger = {
			OR = {
				AND = {
					num_of_max_electors = { value = 8 }
					calc_true_if = {
						all_elector = {
							is_an_ecclesiastical_country = yes
						}
						amount = 5
					}
				}
				AND = {
					NOT = { num_of_max_electors = { value = 8 } }
					calc_true_if = {
						all_elector = {
							is_an_ecclesiastical_country = yes
						}
						amount = 4
					}
				}
			}
        }
    }
	text = {
        localisation_key = string_num_of_secular_or_ecclesiastical_electors_green
        trigger = {
			always = yes
        }
    }
}

defined_text = {
    name = GetSecularElectorsGreenRed
	random = no

    text = {
        localisation_key = string_num_of_secular_or_ecclesiastical_electors_red
        trigger = {
			calc_true_if = {
				all_elector = {
					is_a_secular_country = yes
				}
				amount = 5
			}
        }
    }
	text = {
        localisation_key = string_num_of_secular_or_ecclesiastical_electors_green
        trigger = {
			always = yes
        }
    }
}

defined_text = {
    name = GetMaxNumberOfElectors
	random = no

    text = {
        localisation_key = 10
        trigger = {
			num_of_max_electors = { value = 10 }
        }
    }
    text = {
        localisation_key = 9
        trigger = {
			num_of_max_electors = { value = 9 }
        }
    }
    text = {
        localisation_key = 8
        trigger = {
			num_of_max_electors = { value = 8 }
        }
    }
    text = {
        localisation_key = 7
        trigger = {
			num_of_max_electors = { value = 7 }
        }
    }
    text = {
        localisation_key = 6
        trigger = {
			num_of_max_electors = { value = 6 }
        }
    }
    text = {
        localisation_key = 5
        trigger = {
			num_of_max_electors = { value = 5 }
        }
    }
    text = {
        localisation_key = 4
        trigger = {
			num_of_max_electors = { value = 4 }
        }
    }
    text = {
        localisation_key = 3
        trigger = {
			num_of_max_electors = { value = 3 }
        }
    }
    text = {
        localisation_key = 2
        trigger = {
			num_of_max_electors = { value = 2 }
        }
    }
    text = {
        localisation_key = 1
        trigger = {
			num_of_max_electors = { value = 1 }
        }
    }
	text = {
        localisation_key = 0
        trigger = {
			always = yes
        }
    }
}