I haven't looked at shadowedUF but this is how it would look with oUF.
Code:
oUF.Tags['freeb:altpower'] = function(u)
local cur = UnitPower(u, ALTERNATE_POWER_INDEX)
local max = UnitPowerMax(u, ALTERNATE_POWER_INDEX)
if cur then
return (cur.."P")
end
end
oUF.TagEvents['freeb:altpower'] = "UNIT_POWER UNIT_MAXPOWER"