// Returns Item property damage bonus vs. specific alignment.  You must specify the
// specific alignment constant(IP_CONST_ALIGNMENT_*) and the damage type constant
// (IP_CONST_DAMAGETYPE_*) and the amount of damage constant(IP_CONST_DAMAGEBONUS_*).
// NOTE: not all the damage types will work, use only the following: Acid, Bludgeoning,
//       Cold, Electrical, Fire, Piercing, Slashing, Sonic.  
itemproperty ItemPropertyDamageBonusVsSAlign(int nAlign, int nDamageType, int nDamage);

int nDamageType is a remnant from NWN1 and should not be used. NWN2 treats all damage of 'vs. type' as magical, except for enhancement bonuses where it is treated as physical. If you encounter errors while implementing these functions in your scripts, it might not be due to any error on your part, but due to the fact that the 'vs. type' functions are innately bugged as of the time of this writing.

Fortunately, there is a fix for this problem, here.