I never worked with a damage detecting system. But if I'm correct, there's a tutorial about it on THW. It's made to detect how much damage is done to a unit, but it can also be used to check if a unit is damaged at all. If you use that, you simply add an integer variable 'AttackTimes = AttackTimes + 1' to the trigger, so it you will count the amount of times a unit has taken damage, which you can use for whatever you want to use it for.