game over death state conditional branch not working

hello, im using galv's "actor duel mini game" script and its perfect i have no problems with the script itself
however ive stumbled across a problem when the "fight" is over i tried to use this conditional branch
"cond branch: if (main character/player) [death] is inflicted:
@> game over
@>
else
@> text: you win!"

this doesnt actually work and it instead shows the victory even if you lost(when death state is inflicted to character) and when i switched the text with game over it would show a game over but never a victory even if you didnt die
i have tried setting a common event parallel process to show a game over if death state is inflicted but that didnt seem to work either

if anyone can lead me in the right direction it would be much appreciated! thank you for your time! :0)
please show screenshots of the entire event - listing the commands is not enough.
I can think of several ways what you might have done wrong, but need to know more about the event to check which case might apply here.
Spoiler: event image
1597683197367.png
edit: my bad! is this what you meant?
here you go!
no
I specifically said that I need more than just the commands listed.
please give a screenshot of the entire event without cropping away the event properties
my bad i didnt think there'd be anything revealing with the whole event being shown
updated the image
options like triggers etc can cause a lot of problems when used in the wrong situation, but this looks ok.
so the problem has to be within the script - can you link to the website of the script for cross-checking?
here it is

i should probably tell you i did tweak quite a bit of the script to my liking but i believe the only part that i changed that might affect this conditional branch would have to be: "line 882: @hp = 1 if @hp <= 0"
which i changed to: "@hp = 0 if @hp <= 0"
in hopes it would give the characters the death state which worked but it might also be the culprit of the conditional branch problem
where did you get the idea that the loser would get the death state?
according to the script the winner will be stored in the variable you only check for "no winner" (which is zero) but never for the ID of the winner.
well when you start the fight any states inflicted like poison or death show beneath the hp bar and after the fight if you remove the "recover all: entire party" from the event whoever loses keeps their health from the fight which in the original script was 1 hp which isnt actually dead obviously
so i set it to 0 in hopes that it would inflict the death state even after the fight(which it does) and i could set a conditional branch that if the player had the death state inflicted it would play the game over scene (which it does not)
The engine needs to process the HP to determine if the death state should be applied, and that script is outside the regular engine behaviour - especially because you modified it.
you either need to manually add the death state where you modified the script (my best guess is that Galv intentionally wrote that battle to not enable death functions, which is why he set HP to 1 in it), or ignore the death state and check for winner first and then apply death if the actor is not yet dead.
thank you so much! this worked like a charm!
Spoiler: solution image
1597696128826.png
exactly what i needed! thank you andar!! :0))

Original thread: https://forums.rpgmakerweb.com/threads/game-over-death-state-conditional-branch-not-working.125373/