Hands-On Usage
remove_province_modifier is commonly used in the "cleanup phase" of events or decisions, such as removing temporary province bonuses previously applied via add_province_modifier after a special event concludes (e.g., infrastructure damage, occupation-period special effects, etc.). It also works well in mods paired with recurring decisions to implement "buff rotation"—first remove the old modifier, then add a new one.
# Example: Remove port blockade modifier after blockade is lifted
state_event = {
id = blockade.2
...
immediate = {
remove_province_modifier = {
static_modifiers = { port_blockade_penalty }
province = {
limit_to_naval_base = yes
}
}
}
}
Synergy
[add_province_modifier](/wiki/effect/add_province_modifier): The most direct companion command. Typically you use it to add the modifier first, then use remove_province_modifier at the appropriate time to remove it, forming a complete "add—remove" lifecycle.
[has_occupation_modifier](/wiki/trigger/has_occupation_modifier): Use together in limit blocks to check whether the target province actually has a certain modifier beforehand, avoiding unnecessary warning logs when trying to remove a non-existent modifier.
[add_state_modifier](/wiki/effect/add_state_modifier): Sometimes province-level and state-level modifiers need to be cleared synchronously. Use both together in the same event option to maintain logical consistency.
[any_province_building_level](/wiki/trigger/any_province_building_level): Can be used in conditional checks to filter provinces with specific building levels before executing the removal, giving precise control over the scope of modifier cleanup.
Common Pitfalls
-
province block has no effect when unspecified: The province field is mandatory. Beginners often write only static_modifiers and forget to specify the target province, causing the command to fail silently—no error is reported, but the modifier is not removed either. You must explicitly write province = 500 or use province filtering options (such as all_provinces).
-
Modifier name must match exactly what was used in add_province_modifier: If you originally added a modifier as my_port_mod but write my_Port_mod (different casing) or misspell it when removing, the game won't report an error but the modifier won't be removed, causing it to permanently persist on the province. It's recommended to use constants or comments in your script to standardize modifier names.