#APPLY CHANGES
execute as @s[nbt={Inventory:[{Slot:-106b,components:{"minecraft:custom_data":{svm_ep.sword_ability_movement:1b}}}]}] run scoreboard players set %MOVEMENT_TYPE svm_ep.style_ability 1
execute as @s[nbt={Inventory:[{Slot:-106b,components:{"minecraft:custom_data":{svm_ep.sword_ability_movement:2b}}}]}] run scoreboard players set %MOVEMENT_TYPE svm_ep.style_ability 2
execute as @s[nbt={Inventory:[{Slot:-106b,components:{"minecraft:custom_data":{svm_ep.sword_ability_movement:3b}}}]}] run scoreboard players set %MOVEMENT_TYPE svm_ep.style_ability 3
execute as @s[nbt={Inventory:[{Slot:-106b,components:{"minecraft:custom_data":{svm_ep.sword_ability_movement:4b}}}]}] run scoreboard players set %MOVEMENT_TYPE svm_ep.style_ability 4
execute as @s[nbt={Inventory:[{Slot:-106b,components:{"minecraft:custom_data":{svm_ep.sword_ability_movement:5b}}}]}] run scoreboard players set %MOVEMENT_TYPE svm_ep.style_ability 5

execute as @s[nbt={Inventory:[{Slot:-106b,components:{"minecraft:custom_data":{svm_ep.sword_ability_slash:1b}}}]}] run scoreboard players set %SLASH_TYPE svm_ep.style_ability 1
execute as @s[nbt={Inventory:[{Slot:-106b,components:{"minecraft:custom_data":{svm_ep.sword_ability_slash:2b}}}]}] run scoreboard players set %SLASH_TYPE svm_ep.style_ability 2
execute as @s[nbt={Inventory:[{Slot:-106b,components:{"minecraft:custom_data":{svm_ep.sword_ability_slash:3b}}}]}] run scoreboard players set %SLASH_TYPE svm_ep.style_ability 3
execute as @s[nbt={Inventory:[{Slot:-106b,components:{"minecraft:custom_data":{svm_ep.sword_ability_slash:4b}}}]}] run scoreboard players set %SLASH_TYPE svm_ep.style_ability 4

execute as @s[nbt={Inventory:[{Slot:-106b,components:{"minecraft:custom_data":{svm_ep.sword_ability_charge:1b}}}]}] run scoreboard players set %SPEED_TYPE svm_ep.style_ability 1
execute as @s[nbt={Inventory:[{Slot:-106b,components:{"minecraft:custom_data":{svm_ep.sword_ability_charge:2b}}}]}] run scoreboard players set %SPEED_TYPE svm_ep.style_ability 2


#CONSTRUCT ABILITY
scoreboard players reset @s svm_ep.style_ability

execute if score %MOVEMENT_TYPE svm_ep.style_ability matches 1 run scoreboard players add @s svm_ep.style_ability 100
execute if score %MOVEMENT_TYPE svm_ep.style_ability matches 2 run scoreboard players add @s svm_ep.style_ability 200
execute if score %MOVEMENT_TYPE svm_ep.style_ability matches 3 run scoreboard players add @s svm_ep.style_ability 300
execute if score %MOVEMENT_TYPE svm_ep.style_ability matches 4 run scoreboard players add @s svm_ep.style_ability 400
execute if score %MOVEMENT_TYPE svm_ep.style_ability matches 5 run scoreboard players add @s svm_ep.style_ability 500

execute if score %SLASH_TYPE svm_ep.style_ability matches 1 run scoreboard players add @s svm_ep.style_ability 10
execute if score %SLASH_TYPE svm_ep.style_ability matches 2 run scoreboard players add @s svm_ep.style_ability 20
execute if score %SLASH_TYPE svm_ep.style_ability matches 3 run scoreboard players add @s svm_ep.style_ability 30
execute if score %SLASH_TYPE svm_ep.style_ability matches 4 run scoreboard players add @s svm_ep.style_ability 40

execute if score %SPEED_TYPE svm_ep.style_ability matches 1 run scoreboard players add @s svm_ep.style_ability 1
execute if score %SPEED_TYPE svm_ep.style_ability matches 2 run scoreboard players add @s svm_ep.style_ability 2

#ADD TO MOVESET
execute as @s[scores={svm_ep.fighting_style_creator_slot=1}] run scoreboard players operation @s svm_ep.style_ability1 = @s svm_ep.style_ability
execute as @s[scores={svm_ep.fighting_style_creator_slot=2}] run scoreboard players operation @s svm_ep.style_ability2 = @s svm_ep.style_ability
execute as @s[scores={svm_ep.fighting_style_creator_slot=3}] run scoreboard players operation @s svm_ep.style_ability3 = @s svm_ep.style_ability

tellraw @s ["",{"text":"| Applied changes to slot: ","color":"gray"},{"score":{"name":"@s","objective":"svm_ep.fighting_style_creator_slot"},"color":"dark_red"}]
execute at @s run playsound minecraft:block.note_block.cow_bell master @s ~ ~ ~ 1 2
tag @s remove create