You've put in an 'if' statement where it should be an 'elseif', try this instead, should work.
Code:
if not (unit == "targettarget" or unit == "focustarget") then
local hpp = createFont(hp, "OVERLAY", font, fontsize, fontflag, 1, 1, 1)
hpp:SetPoint("RIGHT", hp, -2, 0)
if(unit == "player") then
self:Tag(hpp, '[freeb:hp]')
elseif(unit == "target") then
self:Tag(hpp, '[syliha:hp]')
else
self:Tag(hpp, '[freeb:pp] [freeb:hp] [syliha:hp]')
end
end
end