# [KNIGHT] Resilience Checks
execute if entity @a[scores={limitbreak_chosen_class=2}] run function kiwi2:upgrades/classes/knight/knight_enchant_resilience

# [HUNTER] Precision Checks
execute if entity @a[scores={limitbreak_chosen_class=3}] run function kiwi2:upgrades/classes/hunter/hunter_enchant_mastery

# [MONK] Abstinence
execute as @a[scores={limitbreak_chosen_class=7}] at @s if predicate kiwi2:holding_weapon run function kiwi2:upgrades/classes/monk/monk_class_ascetic
execute as @a[scores={limitbreak_chosen_class=7}] at @s unless predicate kiwi2:wearing_any_armor run function kiwi2:upgrades/classes/monk/monk_class_ascetic_heavy
execute as @a[scores={limitbreak_chosen_class=7}] at @s if score @s MonkDamageDealt matches 1.. run function kiwi2:upgrades/classes/monk/monk_xp_gain

# [MAGUS] Float
execute as @a[scores={limitbreak_chosen_class=5},tag=!limitbreak_dead_player,tag=!magus_flashfreeze_ongoing] at @s if predicate kiwi2:in_air_not_sneaking if block ~ ~-1.8 ~ #air run function kiwi2:upgrades/classes/magus/magus_float
execute as @a[scores={limitbreak_chosen_class=5},tag=!limitbreak_dead_player,tag=!magus_flashfreeze_ongoing] at @s if predicate kiwi2:in_air_sneaking unless predicate kiwi2:holding_magus_wand run function kiwi2:upgrades/classes/magus/magus_float_remove
execute as @a[scores={limitbreak_chosen_class=5},tag=!limitbreak_dead_player,tag=!magus_flashfreeze_ongoing] at @s if predicate kiwi2:on_ground run function kiwi2:upgrades/classes/magus/magus_float_remove

# [NECROMANCER]
    # Soul Reap
execute as @a[scores={limitbreak_chosen_class=8}] at @s if score @s necromancer_soul_reap matches 1.. run function kiwi2:upgrades/classes/necromancer/necromancer_soul_bar_update
execute as @a[scores={limitbreak_chosen_class=8}] at @s if score @r[distance=..10] necromancer_soul_reap matches 1.. run function kiwi2:upgrades/classes/necromancer/necromancer_soul_bar_update
execute as @a[scores={limitbreak_chosen_class=8}] at @s run function kiwi2:upgrades/classes/necromancer/summons/all_summons/summons_tick
    # Auto-Defend Summoner
execute as @a[scores={limitbreak_chosen_class=8}] at @s if entity @s[nbt={HurtTime:1s}] if score @s necromancer_summon_count matches 1.. run function kiwi2:upgrades/classes/necromancer/summons/all_summons/defend_summoner