execute store result score @s cast_cost run data get entity @s SelectedItem.tag.cost
scoreboard players operation @s cast_cost *= @s mana_cost
scoreboard players operation @s cast_cost /= factor mana
