MV Yanfly Item Core & Szyu Crafting system issues

Hey all, so I am running into this problem. Szyu crafting system wont acknowledge items/weapons/armours that are set up to be "independent" and to have Yanflies other plug ins like attachable augments. This means that when I want to make a sword that requires a previous sword I am unable to, pictures below. If I then change the item to "not independent" I am then able to use the weapon to craft a new one but I lose the ability to use attachable augments. Is there a work around for this?

1673539735943.png
1673539756929.png
1673539771919.png
1673539781100.png
As I mentioned before, it would be helpful if you linked to the plugin so that people willing to help you didn't have to search for it to look through the code 😛

But without looking at that, you should be able to do a search and replace in the plugin for turning any instances of "numItems" into "numIndependentItems".

Then take the below and paste it into a text editor, save as a *.js file and include it as a plugin.
Code:
Game_Party.prototype.loseItem = function(item, amount, includeEquip) {
    if (!DataManager.isIndependent(item))
    {
        this.gainItem(item, -amount, includeEquip);
        return;
    }
    var group, found=0;
    switch (item._dataClass)
    {
        case 'item':
            group=this.items();
            break;
        case 'weapon':
            group=this.weapons();
            break;
        case 'armor':
            group=this.armors();
            break;
    }
    for (var i=0; i<group.length; i++)
    {
        if (!group[i])
            continue;
        if (group[i].baseItemId && group[i].baseItemId==item.id)
        {
            found++;
            this.removeIndependentItem(group[i], includeEquip);
            if (found==amount)
                break;
        }
    }
};

After editing the crafting plugin, make sure to right-click and Refresh it in your plugin manager.

Test it out, let us know what works or not.
As I mentioned before, it would be helpful if you linked to the plugin so that people willing to help you didn't have to search for it to look through the code 😛

But without looking at that, you should be able to do a search and replace in the plugin for turning any instances of "numItems" into "numIndependentItems".

Then take the below and paste it into a text editor, save as a *.js file and include it as a plugin.
Code:
Game_Party.prototype.loseItem = function(item, amount, includeEquip) {
    if (!DataManager.isIndependent(item))
    {
        this.gainItem(item, -amount, includeEquip);
        return;
    }
    var group, found=0;
    switch (item._dataClass)
    {
        case 'item':
            group=this.items();
            break;
        case 'weapon':
            group=this.weapons();
            break;
        case 'armor':
            group=this.armors();
            break;
    }
    for (var i=0; i<group.length; i++)
    {
        if (!group[i])
            continue;
        if (group[i].baseItemId && group[i].baseItemId==item.id)
        {
            found++;
            this.removeIndependentItem(group[i], includeEquip);
            if (found==amount)
                break;
        }
    }
};

After editing the crafting plugin, make sure to right-click and Refresh it in your plugin manager.

Test it out, let us know what works or not.
Thank you so much for this and I'm incredibly sorry it took so long for me to reply, had some serious life admin to do. again thank you so much!

Original thread: https://forums.rpgmakerweb.com/threads/yanfly-item-core-szyu-crafting-system-issues.154034/