MZ (SOLVED) Visustella SkillsStatesCore crash when using skill item cost

Hello.
I'm using Visustella plugins for my project and I came across a problem when trying to use the <Item Cost: x name> notetag on a skill. The cost is displayed properly (icon and amount), but when I use the skill the game crashes with this error messages:

rmmz_managers.js:2036 ReferenceError: item is not defined
at Game_Actor.eval (eval at VisuMZ.<computed> (VisuMZ_1_SkillsStatesCore.js:1), <anonymous>:12:20)
at Game_Actor.Game_BattlerBase.<computed>.paySkillCost (VisuMZ_1_SkillsStatesCore.js:3119)
at Game_Actor.Game_Battler.useItem (rmmz_objects.js:3818)
at Function.BattleManager.startAction (rmmz_managers.js:2750)
at Function.BattleManager.startAction (MultiTweaks.js:1217)
at Function.BattleManager.<computed> (VisuMZ_1_BattleCore.js:21927)
at Function.BattleManager.startAction (VisuMZ_3_WeaponAnimation.js:414)
at Function.BattleManager.<computed> (VisuMZ_1_BattleCore.js:21927)
at Function.BattleManager.<computed> [as processTurn] (VisuMZ_2_BattleSystemSTB.js:1802)
at Function.BattleManager.updateTurn (rmmz_managers.js:2620)


I've only found one thread with the same error but the solution (updating it) doesn't apply here, and unfortunately I wouldn't have any idea what I'm doing if I look at the javascript code.

Thanks in advance!


*Edit:
The solution was on the Changelog in an entry for an older version:

Version 1.40: August 17, 2023

  • Bug Fixes!
    • Fixed a bug involving the "Item Cost" skill cost type found in the Plugin Parameters when involving consumable items.
      • If you want to acquire these settings for an already-existing project, do either of the following:
        • Delete the existing VisuMZ_1_SkillsStatesCore.js in the Plugin Manager list and install the newest version.
        • Or create a new project, install VisuMZ_1_SkillsStatesCore.js there, then copy over the "Item Cost" plugin parameters found in the "Skill Cost Types" plugin parameter settings to your current project.

Leaving the post in case someone finds it useful, but feel free to delete it if not necessary.
This thread is being closed due to being solved. If you need it reopened, report it to let us know why. Thank you!

Original thread: https://forums.rpgmakerweb.com/threads/solved-visustella-skillsstatescore-crash-when-using-skill-item-cost.165472/