ability = {	
	CHI_force_attack = {
		name = ABILITY_FORCE_ATTACK
		desc = ABILITY_FORCE_ATTACK_DESC
		icon = GFX_ability_chi_force_attack
		
		sound_effect = command_power_ability_offensive
		
		type = army_leader
		
		allowed = {
			is_leading_army_group = no
			is_border_war = no
			OWNER = {				
				OR = {
					has_completed_focus = CHI_dare_to_die_corps
					has_completed_focus = JAP_advance_one_hundred_million_fireballs
					has_completed_focus = JAP_tennoheika_banzai
					has_completed_focus = CHI_sea_dare_to_die_corps
				}
			}
		}
		
		cost = 0.11
		duration = 168
		
		one_time_effect = {
			add_temporary_buff_to_units = {
				combat_offense = 0.25
				combat_breakthrough = 0.25
				org_damage_multiplier = -1.0
				str_damage_multiplier = 0.25
				war_support_reduction_on_damage = 0.2
				cannot_retreat_while_attacking = 1.0
				
				days = 7
				tooltip = ABILITY_FORCE_ATTACK_TOOLTIP
			}
		}
		
		
		ai_will_do = { #EAI
			base = -1

			modifier = {
				FROM = {
					EAI_MILITARY_ABILITY_force_attack = yes
				}

				set_temp_variable = { tmp = num_units_offensive_combats }
				divide_temp_variable = { tmp = num_units }
				check_variable = { tmp > 0.1 }

				add = 1000
			}

			modifier = {
				FROM = {
					EAI_MILITARY_ABILITY_force_attack_HOLD = yes
				}

				add = -2000
			}

			modifier = {
				FROM = {
					has_war_support > 0.8
					NOT = { has_country_flag = EAI_MILITARY_trend_losing_war }
				}

				set_temp_variable = { tmp = num_units_offensive_combats }
				divide_temp_variable = { tmp = num_units }
				check_variable = { tmp > 0.5 }
				check_variable = { avg_offensive_combat_status < 0.5 }
				
				add = 2
			}
		}
	}

	CHI_force_attack_no_entrenchment_loss = {
		name = ABILITY_FORCE_ATTACK
		desc = ABILITY_FORCE_ATTACK_DESC
		
		sound_effect = command_power_ability_offensive
		
		type = army_leader
		
		allowed = {
			has_dlc = "No Compromise, No Surrender"
			is_leading_army_group = no
			is_border_war = no
			OWNER = {
				has_completed_focus = CHI_know_thy_enemy
			}
		}
		
		ai_will_do = {
			factor = -1
			modifier = {
				FROM = {
					has_war_support > 0.1
					command_power > 1.5
				}
				check_variable = { num_units_offensive_combats > 6 }
				
				set_temp_variable = { temp = avg_offensive_combat_status }
				check_variable = { temp > 0.45 }
				check_variable = { ai_random > temp }
				
				add = 2
			}
		}
		
		cost = 0.22
		duration = 168
		unit_modifiers = {
			dont_lose_dig_in_on_attack = 1
		}
		one_time_effect = {
			add_temporary_buff_to_units = {
				combat_offense = 0.2
				combat_breakthrough = 0.25
				org_damage_multiplier = -1.0
				str_damage_multiplier = 0.6
				war_support_reduction_on_damage = 0.2
				cannot_retreat_while_attacking = 1.0

				
				days = 7
				tooltip = ABILITY_FORCE_ATTACK_TOOLTIP
			}
		}
	}
}