Wraiths have the Life Drain action; on a hit, it forces the target to make a Con save to avoid having their max HP reduced:
Life Drain
The The target must succeed on a DC 14 Constitution saving throw or its hit point maximum is reduced by an amount equal to the damage taken.
Temporary hit pointsSpecters also have a similar ability.
Temporary hit points are said to protect you from injury.
Temporary hit points aren't actual hit points; they are a buffer against damage, a pool of hit points that protect you from injury.
Will Life DrainDrain's max hpHP reduction work if the damage you take is less than the temporary hit points you have? if the damage is less than available temporary hit points?