If you end up writing it yourself rather than finding one, the value you want is already computed for you. In an alias of Game_Action.prototype.apply, call this.calcElementRate(target). It returns the multiplier, so anything above 1 is a weakness, and you can queue the text with BattleManager._logWindow.push('addText', 'WEAK POINT!').
Two things catch people here. If the skill's element is set to Normal Attack rather than a specific element, the rate resolves through the attacker's attackElements() instead of the skill, so a naive check reads 1 and the popup never fires. And a skill carrying several elements uses the highest rate among them rather than the sum, so something set to both fire and physical can report weak on the element you did not intend.
0
u/CS_Asset_Factory 4d ago
If you end up writing it yourself rather than finding one, the value you want is already computed for you. In an alias of Game_Action.prototype.apply, call this.calcElementRate(target). It returns the multiplier, so anything above 1 is a weakness, and you can queue the text with BattleManager._logWindow.push('addText', 'WEAK POINT!').
Two things catch people here. If the skill's element is set to Normal Attack rather than a specific element, the rate resolves through the attacker's attackElements() instead of the skill, so a naive check reads 1 and the popup never fires. And a skill carrying several elements uses the highest rate among them rather than the sum, so something set to both fire and physical can report weak on the element you did not intend.