When you code you are basically telling something with no brain exactly what you want it to do, if you don't tell it to do anything, it does nothing. If you don't tell it to die, it will not die.
As a programmer myself, I can say with 100% certainty you are absolutely wrong.
The development process would be more akin to
Create Person object type.
Create Combat/Damage procedures
Create Death Check.
Create Death Procedure
Apply combat/damage/death procedures to person object.
This will apply to every single person object. No more coding is needed. Each of those procedures are already needed for creature combat too. It's a core part of the game.
However to make creatures/persons essential requires more work.
Create isEssential flag
Create DeathIntervention procedure and animation
Manually sort through list of NPCs and apply flag to applicable persons.(Or apply to all and remove from applicable persons)