API:UnitHealth

Get the current percentage health of a unit.
UnitHealth("unit")
== Parameter ==
:;unit
::String - the UnitId (e.g. "target", "party1", "raid1", etc..)
== Returns ==
:;health 
::Integer - current health of the specified unit in health points. Returns nil if the specified unit does not exist (eg. "target" given but there is no target).
== Notes ==
For players, this function returns their real current health, but for npcs and mobs, it returns a percentage (0 to 100).
== Examples ==
Print your health to the Say channel.
SendChatMessage("My health is " .. UnitHealth("player"),"SAY")
Snipped for health in your addon
local unitId = "player";
local maxHP = UnitMaxHealth(UnitId);
local curHP = UnitHealth(UnitId);
UnitHealth