If you're using UNIT_HEALTH as suggested by Trimble_Epic (which is correct, by the way Trimble), the exact line is ...
local var = floor(UnitHealth(arg1) / UnitHealthMax(arg1) * 100)
Otherwise you just specify the unit directly to the functions as stated by everyone else. It's actually possible too to get a 'one decimal point' variant. This is code I bastardized from a tip given by industrial ...
local var = UnitHealth(arg1) / UnitHealthMax(arg1) * 100
var = format("%.1f%", var)
That way, if the health it returns is 36.991251059125...blah, then you'll just get '36.9%' as a return from the var variable.
My approach to this would be to have the unit object request UNIT_HEALTH messages from my event distributor when the arg1 is the unit object's self.PartyID. The unit object would maintain it's own knowledge of it's current health based on the events it receives.
Then, when I want to ask it for it's health percent, I would call math.floor(unit:HealthPercent()) which would probably be implemented something like this:
return self.health / self.maxHealth * 100
One thing to consider with trying to find a unit's health percent is that if the unit is NOT in your party or raid, then UnitHealth() already returns the health percent, not the absolute health. However, since UnitHealthMax() always returns 100 when the unit is NOT in your party or raid, then the math still works out ok ;)