I'll upload the mod and the current save I'm using for testing. I wish I had a vanilla set to pass you for testing but this is all X-piratez.
As part of testing I disabled my separate script.rul file and add the script part directly into the items.rul file that sets the script values for each of the armors.
With the sav file, you have about 4 swipes with the stun baton to take down the ratman in front of you. I just reload and try again.
As far as improvements or additions to these scripts.... I'm still trying to completely understand them, and it feels like I only grasp about 40%....
Like I understood that you said debug_log could accept two ints, but not what they mean. I increased the first number to differentiate them through the script, but just left "1" as the second number. I suppose that just gave it a value to return if it was successful? Also, I didn't realize how the "test" parameter would work with the debugger too.
Some thoughts I had that could be done with these scripts though, how about recoloring the floor sprite to indicate these different states. Gray for dead, pink for wounded, blue for stunned.... etc. Also, with the ability to script for unit morale, it seems possible to set up a marker for "panicked" units much like what XCOM Apocalypse had.
Edit: I also have no clue as to what the initial "- Offset= 1" line is about.
Edit 2: Also, I got errored results inserting "debug_log test sprite_index" :
[18-07-2016 15:48:14] [ERROR] Unknown argument 'test'
[18-07-2016 15:48:14] [ERROR] Error in maching arguments for operator 'debug_log'
[18-07-2016 15:48:14] [ERROR] Error in parsing script 'selectItemSprite' for 'Global Event Script': invalid operation in line: 'debug_log test temp;'