execute if entity @s[tag=!mage_armor] run scoreboard players add @s n_effects 1

execute if entity @s[tag=!mage_armor] run scoreboard players operation @s mage_armor = duration n_effects
execute if entity @s[tag=mage_armor] if score @s mage_armor < duration n_effects run scoreboard players operation @s mage_armor = duration n_effects

tag @s add mage_armor

playsound custom.armor.equip_netherite.no_subtitle hostile @a ~ ~ ~
playsound custom.spell.cast.boost hostile @a ~ ~ ~
playsound custom.spell.cast.boost2 hostile @a ~ ~ ~
