scoreboard players set @a[scores={magSPAS=8..},nbt={SelectedItem:{components:{"minecraft:custom_data":{weapon:"spas12"}}}}] shiftreload 0

execute as @a[scores={shiftreload=2..},nbt=!{SelectedItem:{components:{"minecraft:custom_data":{weapon:"spas12"}}}},tag=spas12Reloading] run function ray_demo:reload/spas12/reset
execute as @a[scores={shiftreload=0},nbt={SelectedItem:{components:{"minecraft:custom_data":{weapon:"spas12"}}}},tag=spas12Reloading] run function ray_demo:reload/spas12/reset
execute as @a[scores={shiftreload=2..},nbt={SelectedItem:{components:{"minecraft:custom_data":{weapon:"spas12"}}}},tag=!spas12Reloading] run function ray_demo:reload/spas12/reset
execute as @a[scores={shiftreload=2..,spas12CD=1..},nbt={SelectedItem:{components:{"minecraft:custom_data":{weapon:"spas12"}}}}] run function ray_demo:reload/spas12/reset
execute as @a[scores={shiftreload=1..,spas12CD=..0,18mm=1..},nbt={SelectedItem:{components:{"minecraft:custom_data":{weapon:"spas12"}}}}] run tag @s add spas12Reloading