Nonlethal Damage (5e Variant Rule)
From D&D Wiki
Alongside a creature's health, also track the total nonlethal damage that they have accumulated. When this value exceeds their current hit points, they immediately fall unconscious. A creature knocked out this way remains unconscious until their hit points once again exceed or are equal to their nonlethal damage total. If a creature would have negative nonlethal damage points, put it back to zero instead.
Nonlethal damage naturally bleeds away over time. A creature's nonlethal damage total decreases by 5 points every hour, to a minimum of 0 points. Whenever a creature finishes a short or long rest, the total is instead reduced by 10 points for every hour spent resting.
Nonlethal damage can be used by both players and NPCs alike to try to knock out a target without killing them or risking them dying to death saving throws or the like. Whenever you use the attack action, you may call the attack as nonlethal. If the attack hits, it deals its damage to the creature's nonlethal damage total instead of their hit points.