function onAdvance(cid, skill, oldLevel, newLevel)
if skill == 8 then
local hp = getCreatureHealth(cid)
local mana = getCreatureMana(cid)
addEvent(doCreatureAddHealth, 100, cid, hp - getCreatureMaxHealth(cid))
addEvent(doCreatureAddMana, 100, cid, mana - getCreatureMaxMana(cid))
end
end
maybe this