How to check via script call if a attack is of a certain attribute

I have a enemy which reflects physical attacks, but I wan't to add an exception, if the attack comes from a projectile the damage should be calculated normally. I use the Yanfly script for custom state effect and want to add to my if condition if the attack is from the attribute from the specific id.
I looked at the script call list from this subforum but couldn't find anything regarding this.
That's a tough one... We'd have to think outside of the box on this, because I don't think Element Core has a Lunatic Mode for Reflect Rates.

I think I might have a way, but that depends on how you're determining projectile damage. Is it determined through a weapon? Or can someone have a close ranged weapon and still deal "projectile" damage with a separate skill?
For now it is only attached to a weapon.

The state looks like this I used the script on that yanfly video for thorn armor.

<Custom React Effect>
// Check to see if any physical damage is dealt.
if (value > 0 && this.isPhysical()) {
// Sets the Recoil Rate to 30%.
var rate = 0.30;
// Determines the amount of recoil damage dealt.
var recoil = value * rate;
// Sets the DEF bonus rate to 50%.
var rate = 0.50;
// Determines the amount of bonus damage dealt.
var bonus = ((target.atk * rate * 3) - user.def);
// Rounds up the bonus damage and recoil damage.
var dmg = Math.ceil(bonus + recoil);
//Hit animation
user.startAnimation(135);
// Makes the attacker lose damage equal to the dmg variable.
user.gainHp(-1 * dmg);
// Check to see if the attacker is dead.
if (user.isDead()) {
// If the attacker is dead, make it collapse.
user.performCollapse();
}
}
</Custom React Effect>

Somehow I need to ask for the attribute of the weapon which is used.

if (value > 0 && this.isPhysical() && weapon.attacktypeID != x)

I have no freaking idea.

Original thread: https://forums.rpgmakerweb.com/threads/how-to-check-via-script-call-if-a-attack-is-of-a-certain-attribute.89250/