This is official behavior though. GTB only blocks magic-type skills, it does not protect from Coma.
I guess looking at your code, you want to customize it so that GTB also blocks various other effects. I don't understand why someone would want to buff GTB card even more, but if you really want to still do it, you need to understand that Coma is no longer a status change, it actually overwrites damage and sets it to "TargetCurrentHP - 1".
The logic for Coma is now in status_damage:
// We need to log the real damage on exp_calc_type 1
if (battle_config.exp_calc_type == 1) {
dhp = hp;
// Coma real damage
if (flag&16)
dhp = status->hp - 1;
}
status->hp-= hp;
status->sp-= sp;
status->ap-= ap;
// Coma
if (flag&16) {
status->hp = 1;
status->sp = 1;
if (!sp) sp = 1; // To make sure the status bar is updated
}
It's called from battle_damage in battle.cpp here:
else if (sd && battle_check_coma(*sd, *target, (e_battle_flag)attack_type))
dmg_change = status_damage(src, target, damage, 0, delay, 16, skill_id); // Coma attack
Probably easiest to add the check for status_isimmune there:
else if (sd && battle_check_coma(*sd, *target, (e_battle_flag)attack_type) && !status_isimmune(target))
dmg_change = status_damage(src, target, damage, 0, delay, 16, skill_id); // Coma attack