API:UnitChangeHealth

Get the health change of a unit during the current tick (one tick is 2 seconds).
UnitChangeHealth("unit")
== Parameter ==
:;unit
::String - the UnitID (e.g. "target", "party1", "raid1", etc..) 
== Returns ==
:;health 
::Integer - points of resored healthpoints since last tick, i.e. "12".
== Example ==
Print your health to the Say channel from within your addon-xml-file.
<Scripts>
 <OnLoad>
 this:RegisterEvent("UNIT_HEALTH");
 </OnLoad>
 <OnEvent>
 if (event == "UNIT_HEALTH") then
 SendChatMessage("My health changed by " .. UnitChangeHealth("player") .. " points.","SAY");
 end
 </OnEvent>
</Scripts>
UnitChangeHealth