how to detect if any entity took damage?

I basically want to detect if any entity took any damage (execute as @e) and if they did it'll run a function that damages them

Continue to help post