Hands-On Usage
remove_dynamic_modifier is commonly used to clear previously applied dynamic modifiers when events or decisions expire—for example, removing temporary military bonuses granted by a treaty with another nation, or cleaning up modifier effects tied to a character upon their death or dismissal. The example below demonstrates removing a dynamic modifier from Germany after a decision completes:
# Within an option or complete_effect block
GER = {
remove_dynamic_modifier = {
modifier = ger_rearmament_bonus
scope = GER # If a scope was passed to add_dynamic_modifier originally, it must match here
}
}
Synergy
[add_dynamic_modifier](/wiki/effect/add_dynamic_modifier) — Used as a paired command; apply the modifier with add_dynamic_modifier first, then remove it at the appropriate time with this command. This represents the standard workflow for dynamic modifier lifecycle management.
[force_update_dynamic_modifier](/wiki/effect/force_update_dynamic_modifier) — When variables referenced by a dynamic modifier have changed but the values haven't refreshed yet, removing and re-adding the modifier in conjunction with this command forces an immediate numerical update.
[has_dynamic_modifier](/wiki/trigger/has_dynamic_modifier) — Use this trigger to verify that the dynamic modifier actually exists on the target scope before removal, preventing warning logs from attempting to remove non-existent modifiers.
[add_days_remove](/wiki/effect/add_days_remove) — If you want a dynamic modifier to automatically expire after a set duration, pair add_days_remove when adding the modifier rather than manually removing it with this command. Both approaches have their appropriate use cases.
Common Pitfalls
- The
scope parameter must match what was used in add_dynamic_modifier: If the modifier was added with scope = GER but the scope parameter is omitted during removal, the game cannot match the correct modifier, causing the removal to fail silently—the modifier remains active and becomes extremely difficult to debug.
- Executing in the wrong scope:
remove_dynamic_modifier must be called within the same type of scope where the modifier is actually attached (country/state/character/special project). If a modifier is attached to a STATE but you attempt removal within a COUNTRY scope, the command will not take effect across scopes. You must first switch to the correct scope block before executing the command.