I created an object and gave it an object script. The idea is to be able to share this with an NPC or CM partner, or any companion really.
My approach was to wait until they are knocked out, modav fatigue 9999 but that only pins them down so they cannot move. Once they wake up from the initial death (where essentials go unconscious) they stand back up but cannot move, but heal themselves. Not the desired effect.
I then tried modav health -9999 but they seem to heal their way out of that one too and wake up shortly. At least companion Vilja did, I could try it on a CM partner but I guess they might do the same.
Here is my script, any ideas are welcome.
scn aaacompanioncontrollerscriptref ownershort CompanionMessage; Begin OnAdd set owner to getcontainer if owner !=player && owner.isessential == 0 setessential owner 1 endifendBegin gamemodeIf CompanionMessage == 4 && owner.getknockedstate!=3;negative fatigue knockout set companionMessage to 0;restarting or resetting everythingendifIf CompanionMessage == 3 addtopic WakeUpTopic set CompanionMessage to 4endifIf CompanionMessage == 2 owner.modav2 encumbrance 9999 owner.modav2 health -9999 set CompanionMessage to 3endifif CompanionMessage == 1 message "Your companion needs revived." set CompanionMessage to 2endifif owner.getknockedstate == 1 && CompanionMessage == 0 set CompanionMessage to 1endifEnd