Reduce scoreboard value instantly by the value of another score

Okay so if I understand correctly, you have a scoreboard objective let's call it damageTaken. Each player's score is set to how much damage they take. If this is the case then you should be able to do

/execute if entity @a[scores={damageTaken=2..}] store success score @s damageTaken run scoreboard players operation @s health -= @s damageTaken

This works as long as the damageTaken score is greater than 1 (just fix that by making the minimum damage 2 or make it multiples of 10 or something). It's just one command, it works for multiplayer, and it resets itself

-cheers