Hands-On Usage
add_unit_bonus is best used in national focuses, technology decisions, or events to permanently enhance combat attributes of specific unit types or unit categories for a particular nation. For example, you might grant additional soft attack to light infantry for an infantry-specialist nation, or simultaneously boost both soft and hard attack for a cavalry-focused great power. Note that this bonus is permanent in nature, unlike dynamic modifiers which can be removed at any time. This makes it suitable for "milestone-style" rewards rather than temporary buffs.
# Strengthen light infantry and cavalry upon completion of a national focus
complete_national_focus = focus_infantry_doctrine
immediate = {
add_unit_bonus = {
category_light_infantry = {
soft_attack = 0.05
name = infantry_bonus_name
}
cavalry = {
soft_attack = 0.05
hard_attack = 0.05
name = cavalry_bonus_name
}
}
}
Synergy
[add_tech_bonus](/wiki/effect/add_tech_bonus): These two effects frequently trigger simultaneously within the same focus or event—one accelerates technology research while the other directly grants unit attribute bonuses, together forming the reward package for a military specialization path.
[add_ideas](/wiki/effect/add_ideas): National spirits typically carry global modifiers, while add_unit_bonus targets specific unit types. Combined, they enable "macro + micro" layered military strengthening.
[add_dynamic_modifier](/wiki/effect/add_dynamic_modifier): Dynamic modifiers are removable and condition-responsive, complementing add_unit_bonus's permanent bonuses—use dynamic modifiers for temporary combat states and this command for permanent milestone achievements.
[has_completed_focus](/wiki/trigger/has_completed_focus): Commonly serves as a trigger condition to ensure only nations that have completed prerequisite focuses continue receiving subsequent unit rewards, preventing sequence confusion.
Common Pitfalls
- Misspelling unit category keys: Keys like
category_light_infantry with the category_ prefix and direct unit names (such as cavalry) follow the same syntax but carry different meanings. The former affects all sub-units within that entire category, while the latter only affects that specific unit type. Newcomers often mix these up or misspell category names, causing bonuses to silently fail with no obvious error message from the game.
- Assuming repeated calls with the same
name key will override the previous bonus: add_unit_bonus is additive, not replacive. Multiple triggers will continuously stack values. If your design intends to grant the bonus only once, you must pair it with deduplication logic using [has_country_flag](/wiki/trigger/has_country_flag) or similar flagging mechanisms. Otherwise, repeatedly triggered events or decisions will cause bonuses to accumulate infinitely.