scoreboard players set @s spell_cost_current 340
scoreboard players operation @s spell_cost_current /= @s mana_efficiency
execute if score @s magus_mana_bar < @s spell_cost_current run function kiwi2:upgrades/classes/magus/spells/not_enough_mana_warning

execute unless score @s magus_mana_bar < @s spell_cost_current run scoreboard objectives add magus_tornado_duration dummy
execute unless score @s magus_mana_bar < @s spell_cost_current run execute anchored eyes positioned ^ ^-0.25 ^ summon bat run function kiwi2:upgrades/classes/magus/spells/tier_2/tornado_launch_logic
execute unless score @s magus_mana_bar < @s spell_cost_current run title @s actionbar [{"text": "[TORNADO]","color": "#b2c2ab","bold": true},{"text": " -","bold": false,"color": "red"},{"score": {"name": "@s","objective": "spell_cost_current"},"bold": false,"color": "red"},{"text": " Mana","bold": false,"color": "red"}]

execute unless score @s magus_mana_bar < @s spell_cost_current run function kiwi2:upgrades/classes/magus/spells/wand_stability

execute unless score @s magus_mana_bar < @s spell_cost_current run scoreboard players operation @s magus_mana_bar -= @s spell_cost_current