tag @s add nl_Caster
loot spawn ~ ~ ~ loot next_level:magic/dmg_frozen_staff
execute store result score @s nl.MagicDamage run data get entity @e[limit=1,sort=nearest,nbt={Item:{tag:{nl_MagicDMG:1b}}}] Item.tag.AttributeModifiers.[0].Amount
kill @e[nbt={Item:{tag:{nl_MagicDMG:1b}}}]
execute at @s[scores={nl.MP.Current=4..}] positioned ~ ~1.4 ~ run function next_level:magic/staffs/frozen/cast
execute at @s[scores={nl.MP.Current=4..}] positioned ~ ~1.4 ~ run function next_level:magic/staffs/reduce_durability
execute at @s[scores={nl.MP.Current=4..}] run playsound minecraft:entity.iron_golem.death voice @s ~ ~ ~ 1 2
scoreboard players remove @s[scores={nl.MP.Current=4..},tag=!nl_CoolDownStaff] nl.MP.Current 4

tag @s remove nl_Caster
