execute as @a[scores={attack_speed=..0}] run scoreboard players operation @s attack_speed = @s attack_speed_max
# execute as @a[scores={charged_attack_speed=..0}] run scoreboard players operation @s charged_attack_speed = @s charged_attack_speed_max