I think it's working now, but I don't really know if this will cause some bug.
if (skill_id != PA_SACRIFICE && skill_id != MO_INVESTIGATE && skill_id != CR_GRANDCROSS && skill_id != NPC_GRANDDARKNESS && skill_id != PA_SHIELDCHAIN && !flag.cri) {
//Elemental/Racial adjustments
if (sd->right_weapon.def_ratio_atk_ele & (1<<tstatus->def_ele)
|| sd->right_weapon.def_ratio_atk_race & map->race_id2mask(tstatus->race)
|| sd->right_weapon.def_ratio_atk_race & map->race_id2mask(is_boss(target) ? RC_BOSS : RC_NONBOSS)
)
flag.pdef = 1;
if (sd->left_weapon.def_ratio_atk_ele & (1<<tstatus->def_ele)
|| sd->left_weapon.def_ratio_atk_race & map->race_id2mask(tstatus->race)
|| sd->left_weapon.def_ratio_atk_race & map->race_id2mask(is_boss(target) ? RC_BOSS : RC_NONBOSS)
) {
//Pass effect onto right hand if configured so. [Skotlex]
if (battle_config.left_cardfix_to_right && flag.rh)
flag.pdef = 1;
else
flag.pdef2 = 1;
}
}
This is the original, I just remove the critical flag(&& !flag.cri) and work.