Core rule
Temporary hit points
Temporary hit points are a separate pool lost before ordinary hit points.
With 5 temporary hit points, taking 8 damage removes that pool and then costs 3 ordinary hit points, assuming no other effects.
Healing spells do not restore temporary hit points. Do not simply add together temporary hit points granted by several effects.