ability = { jap_last_stand = { name = ABILITY_LAST_STAND desc = ABILITY_LAST_STAND_DESC sound_effect = command_power_ability_offensive type = army_leader allowed = { is_leading_army_group = no is_border_war = no OWNER = { OR = { has_completed_focus = JAP_warrior_spirit has_completed_focus = SPA_cultivate_fanaticism } } } cost = 0.05 duration = 168 unit_modifiers = { defence = 0.2 combat_entrenchment = 0.25 org_damage_multiplier = -1.0 str_damage_multiplier = 0.6 cannot_retreat_while_defending = 1.0 } ai_will_do = { factor = -1 modifier = { FROM = { has_war_support > 0.4 } check_variable = { num_units_defensive_combats > 6 } set_temp_variable = { temp = avg_defensive_combat_status } check_variable = { temp < 0.40 } check_variable = { ai_random > temp } add = 2 } } } jap_even_better_last_stand = { name = ABILITY_LAST_STAND desc = ABILITY_LAST_STAND_DESC sound_effect = command_power_ability_offensive type = army_leader allowed = { is_leading_army_group = no is_border_war = no OWNER = { OR = { has_completed_focus = JAP_indoctrination_in_the_military_academy has_completed_focus = JAP_issue_the_senjinkun_military_code } } } cost = 0.05 duration = 240 unit_modifiers = { defence = 0.2 combat_entrenchment = 0.25 org_damage_multiplier = -1.0 str_damage_multiplier = 0.6 cannot_retreat_while_defending = 1.0 } ai_will_do = { factor = -1 modifier = { FROM = { has_war_support > 0.4 } check_variable = { num_units_defensive_combats > 6 } set_temp_variable = { temp = avg_defensive_combat_status } check_variable = { temp < 0.40 } check_variable = { ai_random > temp } add = 2 } } } jap_better_staff_office_plan = { name = ABILITY_STAFF_OFFICE_PLAN desc = ABILITY_STAFF_OFFICE_PLAN_DESC sound_effect = command_power_ability_defensive type = army_leader allowed = { is_border_war = no OWNER = { has_completed_focus = JAP_the_art_of_warfare } } cost = 0.06 duration = 216 unit_modifiers = { planning_speed = 4.0 } ai_will_do = { factor = -1 modifier = { FROM = { command_power > 2.0 } check_variable = { num_units > 6 } check_variable = { unit_ratio_ready_for_plan > 0.55 } check_variable = { avg_unit_planning_ratio < 0.4 } add = 2 } } } }