Reduction in maximum hit points (max HP) is essentially 5e's replacement for the energy drains, level drains and negative levels of earlier editions.1 As such, it is not meant to be easily or quickly overcome, so low-level magic does not work. In fact, the 5e demilich's legendary action is called "energy drain" while many undead in 5e (specters, wights, wraiths) have a "life drain" effect similar to the vampire's bite. However, max HP reduction is not exclusive to vampires or the undead in 5e. Players can temporarily cause the same effect with the 6th-level Harm spell and other monsters have similar attacks that do not involve necrotic damage. The other max HP reducing attacks and their respective cures are:
- blue slaad's claw – unclear (involves disease), but maybe only a wish spell (MM, p. 276)
- chasme's proboscis attack – long rest or spell like greater restoration (MM, p. 57)
- clay golem's slam attack – greater restoration spell or similar magic (MM, p. 168)
- demilich's energy drain – greater restoration spell or similar magic (MM, p. 48)
- mummy's and mummy lord's rotting fist attack – remove curse spell or other magic (MM, pp. 228-229)
- night hag's nightmare haunting – greater restoration spell or similar magic (MM, p. 178)
- otyugh's bite – daily saving throw (involves disease) (MM, p. 248)
- succubus'/incubus' draining kiss – long rest (MM, p. 285)
As listed above, the means of restoring max HP are specified in the description of the ability/effect that causes the reduction to max HP. This is almost always powerful magic (i.e., the 5th-level "greater restoration spell or similar magic") or a long rest, the latter particularly for undead (specter, vampire, wight, wraith). However, a DM can interpret "similar magic" or house rule other powerful magic that can immediately restore max HP. For example, the blue slaad's claw and otyugh's bite create diseases that cause max HP reduction, so the 6th-level spell Heal may work since it "ends ... any diseases." Similarly, Heal washes its target in positive energy, so a DM could rule that it restores max HP to characters affected by the "life drain" of undead.
- The energy drain mechanic in AD&D 2e was the loss of entire levels and everything that had come with each (e.g., HP, proficiencies, skills, spells, etc.) while 3e imposed a -1 penalty on all skill and ability checks, attack rolls, and saving throws, -1 prepared spell and spell slot and -5 max HP (-1 HD). There is an EN World forum thread that anecdotally discusses the psychological impact of level and max HP reduction on players.
Yes, a vampire's bite can sometimes effectively deal extra damage due to temporary hit points
Damage to temporary HP still counts as damage
Per this Jeremy Crawford Tweet:
When temporary hit points absorb damage for you, you're still taking damage, just not to your real hit points.
So, when the bite ability says "hit point maximum is reduced by an amount equal to the necrotic damage taken" that means that max HP will be reduced by the amount of damage done regardless of temp HP.
Your example
In your example, your maximum HP is 20. Your current HP will also start at 20 since you have taken no damage before this. You also start with 20 temporary HP from some spell or effect.
Starting condition
Max HP: 20
Curr. HP: 20
Temp. HP: 20
So, you take 5 piercing damage and 10 necrotic damage.
Max HP: 20
Curr. HP: 20
Temp. HP: 20 - 5 (piercing) - 10 (necrotic) = 5
Then, because of the vampire bite, your maximum HP is reduced by 10.
Max HP: 10
Curr. HP: 10
Temp. HP: 5
And because your maximum HP drops below your current HP, your current HP immediately drops with it. This is because current HP can never exceed max HP:
A creature's current hit points (usually just called hit points) can be any number from the creature's hit point maximum down to 0. This number changes frequently as a creature takes damage or receives healing.
In this case then, a **vampire's bite, will do additional damage to your HP because of the HP drain and the fact that you had temporary HP.
Specifically it did:
5 (piercing)
10 (necrotic)
10 (HP drain)
= 25 damage
A creature without temp HP would have taken 15 damage. So, yes a creature with temp HP in this case actually effectively takes more damage than a creature without.
Temporary HP is not affected by HP drain since it is independent of max HP.
Official ruling
Jeremy Crawford has agreed with this interpretation in this tweet:
Q: You are hit by a Specter's Life Drain for 10 damage. You have 8
temporary hit points. Is your Max HP lowered by 2 or by 10?
A: By 10
Note that I have been referring to the HP maximum reduction as "damage". I do not mean damage in the technical sense (eg effects that depend on "you take damage") but in the common sense that you lost HP thus it is effectively damage.
Best Answer
The Vampire would not heal
The way I read this (if I take your quoted text) is to break it down into individual sentences:
This is clear; the bite, if it hits, does this much damage, and of course, the necrotic damage would be halved due to the resistance to necrotic damage that the Necromancer has.
The next sentence is:
Taken in isolation, since the Necromancer cannot have their maximum hit points decreased, the amount that it has been decreased is effectively 0, regardless of the damage taken as per the previous sentence. Therefore, the vampire would heal by 0, since the vampire regains hit points equal to that amount, which is 0.
Another way to interpret this is that since you cannot have your maximum hit point reduced, this whole sentence cannot apply, so rather than the vampire regaining 0 HP, the vampire simply doesn't get to regain anything since you can't have your maximum hit point reduced. Either way, they resolve the same way; the vampire gets nothing.
This also matches the flavour of the Necromancer's class feature, Inured to Death, which reads "You have spent so much time dealing with undead and the forces that animate them that you have become inured to some of their worst effects" (PHB, pg. 119); since they would have gained a certain resilience to their life force, they cannot have it drained out of them as a normal mortal could. Of course, they can still take damage...