System Shock: A Hard Limit to Lives (5e Variant Rule)
From D&D Wiki
System Shock Points
System Shock is a representation of mortality in its purest form. It represents permanent massive nervous damage that can occur from extremely dangerous situations. The actual magical ability of a character does not matter for system shock. However, beings that are of an inherently magical species, such as Elves, Gnomes, Dragonborn, Half-Elves and Teiflings can have up to 4 points of System Shock before gaining its detrimental effects. Non-magical species, such as Humans, Dwarves, Halflings, and Half-Orcs can only have 3 points of System Shock before gaining its detrimental effects.
To gain a point of System Shock, the character must suffer a blow that deals at least 80% of its maximum health as damage. It also occurs when attacked while unconscious (In addition to the Death Saving Throw fail), whenever the character takes damage from lava, is struck by natural lightning, or takes more than 30 fall damage. A character also gains a level of System Shock if they die and are brought back to life by anything less than a Wish spell or Divine Intervention.
When a character has their species' limit of System Shock points, they immediately fall unconscious and are brought to 0 Hp (If they are already at 0 Hp and Unconscious, they die immediately). If they survive the event, then their maximum Hp becomes 1 and they lose all proficiencies for skills and saving throws, and all saving throws made by them must be at least 3 higher than the DC of the save to successfully save. They can no longer Spellcast, must make a DC 13 Str save to wield any weapon they normally use (Higher for heavier weapons and items at DM's discretion), can't Rage, use Ki points, or be immune or resistant to anything status effect or damage type.
To heal System Shock, they must be treated with a Greater Restoration spell an amount of times equal to the amount of System Shock points they currently have, losing one point of System Shock when this is done successfully within a 7 Day period. Alternatively, a Wish may remove a single point of System Shock, and so can resting for 1 year of time (Yes I know that's impractical, that's intentional), performing only light tasks for that period. The effects of System Shock persist until ALL points are removed, though they only begin to occur when the character has reached that limit for their species.
Most importantly, a character that dies while under the effects of System Shock cannot be revived by magic short of a Wish or some form of Divine Intervention.