scoreboard players remove @s[tag=!magus_meditating] magus_spell_tier_4 1
execute if score @s magus_spell_tier_4 matches ..-1 run scoreboard players set @s magus_spell_tier_4 5
execute if score @s[tag=magus_tier_4_unlocked] magus_spell_tier_4 matches 0 run title @s actionbar {"text":"[ MAGIC MISSILE STORM ]","color":"#59c8f7","bold":true}
execute if score @s[tag=magus_tier_4_unlocked] magus_spell_tier_4 matches 1 run title @s actionbar {"text":"[ GRAVITRON ]","color":"#8e26a0","bold":true}
execute if score @s[tag=magus_tier_4_unlocked] magus_spell_tier_4 matches 2 run title @s actionbar {"text":"[ GEYSER ]","color":"#d64400","bold":true}
execute if score @s[tag=magus_tier_4_unlocked] magus_spell_tier_4 matches 3 run title @s actionbar {"text":"[ LIGHTNING BALL ]","color":"#3bfff8","bold":true}
execute if score @s[tag=magus_tier_4_unlocked] magus_spell_tier_4 matches 4 run title @s actionbar {"text":"[ FLASHFREEZE ]","color":"#9ec5d1","bold":true}
execute if score @s[tag=magus_tier_4_unlocked] magus_spell_tier_4 matches 5 run title @s actionbar {"text":"[ IMPLODE ]","color":"#e05e94","bold":true}
execute if score @s[tag=!magus_tier_4_unlocked] magus_spell_tier_4 matches 1..5 run function kiwi2:upgrades/classes/magus/spells/unable_to_use_magic
playsound minecraft:ui.button.click player @s[tag=!magus_meditating,tag=magus_tier_4_unlocked]