Only feasible way is to store damage done using a damage detection system, but that would be highly inaccurate, as it doesn't account for the unit's armor... ;S other way would be to calculate it yourself, by adding the damage gained from the hero's base damage, plus the damage given from items... which you have to trigger to detect manually. And of course, this would mean no tomes... or spells that increase damage... unless you would like to account for that yourself...
tl;dr: Not worth the effort. Unless you want to do a triggered critical strike.
EDIT: Or you could use the above user's link, but it's still alot of work if you want to account for damage from items and spells :S