Using a skill to toggle respawn was a success smile

I made two skills and put in this code into the story:
Code
IF
CharacterUsedSkill(_Char, "Shout_RespawnEnable", _)
AND
DB_RespawnEnabled(0)
THEN
NOT DB_RespawnEnabled(0);
DB_RespawnEnabled(1);

IF
CharacterUsedSkill(_Char, "Shout_RespawnDisable", _)
AND
DB_RespawnEnabled(1)
THEN
NOT DB_RespawnEnabled(1);
DB_RespawnEnabled(0);

IF
CharacterDied(_Char)
AND
DB_RespawnEnabled(1)
THEN
CharacterResurrect(_Char);

DB_RespawnEnabled(1); was in the INIT section to enable respawning by default for the test.

I then got this result when testing ingame-

[Linked Image]

Scarlett respawned when she died the first time (because respawn was enabled). Roderick then used Disable Respawning Enemies and killed her again. She didn't resurrect that time. He then Enable Respawning Enemies, resurrects Scarlett with a scroll, and kills her one final time to find that she successfully resurrects at full health.