$scoreboard players set $(x) attack_speed 0
$scoreboard players set $(x) weapon_ability_cooldown_s 0
$scoreboard players set $(x) weapon_ability_cooldown_t 0
$scoreboard players set $(x) rc_icd 0
$scoreboard players set $(x) rc_cooldown_s 0
$scoreboard players set $(x) rc_cooldown_t 0
$scoreboard players set $(x) rc_duration_t 0
$scoreboard players set $(x) q_icd 0
$scoreboard players set $(x) q_special 0
$scoreboard players set $(x) q_damage_icd 0
$scoreboard players set $(x) q_cooldown_s 0
$scoreboard players set $(x) q_cooldown_t 0
$scoreboard players set $(x) q_duration_t 0
$scoreboard players set $(x) q_animation_t 0
$scoreboard players set $(x) ability_upgrade_1 0
$scoreboard players set $(x) ability_upgrade_2 0
$scoreboard players set $(x) ability_upgrade_3 0
$data modify storage minecraft:weapon 0$(x) set value {"$(x)":{"ability_1":"","ability_2":""}}

$tag @a remove $(x)_e
$tag @a remove $(x)_q
$tag @a remove $(x)_1
$tag @a remove $(x)_2
$tag @a remove $(x)_3

$execute if data storage minecraft:weapon {0:{$(x):{$(x):{ability_2:"",ability_1:""}}}} run data modify storage minecraft:weapon 0$(x) set value {"$(x)":{"ability_1":"","ability_2":"","id":$(x)}}