Necromancer's Enervation (5e Spell)
From D&D Wiki
You release a black ray of crackling negative energy from your pointed finger that suppresses the life force of any creature it strikes. Make a ranged spell attack against a creature within range. On a hit, the target takes 8d8 necrotic damage, and its maximum hit points are reduced by an amount equal to the necrotic damage taken. This reduction to the target's maximum hit points lasts until the target finishes a long rest. A creature that has its maximum hit points reduced to 0 by this spell dies. A humanoid slain by this spell rises as a zombie under your control at the start of its next turn. If the target has the Spellcasting feature, it loses its highest-level spell slot remaining, to a maximum of 4th level.
This spell has no effect on constructs or undead.
At Higher Levels. When you cast this spell using a spell slot of 5th level or higher, the damage increases by 1d8 for each slot level above 4th, and the maximum spell slot level a target can lose from this spell increases to the level of the spell slot used to cast this spell.