YEP ItemCore & AttachAugments - can't work out baseItem.params or item.params

plugins involved:
Item Core (YEP)
Attachable Augments (YEP)

So, I'm trying to make a system involving improving independent item stats based on the augment attached. Items that are acquired come with an augment that dulls and can be fixed/improved by blacksmiths. I want this augment to be applicable globally to all weapon types, so it's important that it only improves the item's stats rather than the player's ones.

Spoiler: What I'm using
In weapon/armor notetag
<On Creation Eval>
ItemManager.applyAugmentEffects($dataWeapons[1], $dataItems[181+$gameVariables.value(X)], 3, 1);
</On Creation Eval>
(where X = smithing level)

In augment notetag
<Augment Attach Eval: Quality>
item.params[2] += Math.round(baseItem.params[2]*0.4);
</Augment Attach Eval: Quality>

For some reason, when I use 0.2 instead of 0.4 it seems to work. But when I increase by 0.4 and anything else, it stacks the independent item parameters rather than the base. The parameter value I've been modifying for tests is 10, so with 0.2 it goes to 12, but with 0.4 goes to 11, then 9, 8, 7, and stays at 6.
Just from taking a look on your notetags. It seems like in <On Creation Eval> you apply the Augment effect to the base item $dataWeapons[1] instead of the new individual item.

Try instead using this:
JavaScript:
<On Creation Eval>
ItemManager.applyAugmentEffects(item, $dataItems[181+$gameVariables.value(X)], 3, 1);
</On Creation Eval>

Using item instead of $dataWeapons[1] should apply the augment effect to the individual item instead of the base item.
Try instead using this:
JavaScript:
<On Creation Eval>
ItemManager.applyAugmentEffects(item, $dataItems[181+$gameVariables.value(X)], 3, 1);
</On Creation Eval>

That did the trick, thank you so much!
Omg I can totally use this! But I got a few questions:

Does the above code make it so a weapon/armor come w/ the augment attached or simply grants it the effects of the augment?

Also, what would be the reverse of this function? (I'm looking for the code that tells it to remove an augment as well)
Omg I can totally use this! But I got a few questions:

Does the above code make it so a weapon/armor come w/ the augment attached or simply grants it the effects of the augment?

Also, what would be the reverse of this function? (I'm looking for the code that tells it to remove an augment as well)
ItemManager.applyAugmentEffects(item, augment, slot, true/false);
So it adds the augment to a slot.

Reverse is just to use the same code in <Augment Detach Eval: augment> but replace "+=" with "-="

Also, if your item has negative values you can use if (item.params[x] >= 0) {code}; to make sure they don't increase negatives.
: )
Sorry, I'm having trouble wrapping my head around the syntax...

<Augment Detach Eval: Arrow>
ItemManager.applyAugmentEffects(item, augment, slot, true/false);
</Augment Detach Eval: Arrow>

What do I put for augment if I simply want it to reference the currently selected augment in question?

What is the true/false for?

Also, I don't see a "+=" anywhere to replace... I think there was some confusion, by reverse I meant destroying/discarding the augment when you detach it (the opposite of adding an augment).

Thx, in advance!

Edit: Nvm, just realized I probably have to utilize some code from YEP_X_ItemDiscard...
Sorry, I'm having trouble wrapping my head around the syntax...

Just replace at true/false with "1", I'm not sure it matters too much. For augment, you either have to do a variable or a direct number reference. Also, all of this isn't in Detach or Attach, this is <On Creation Eval>. The rest of the code is in the spoilers of the thread's first post, and that's where you'll also find the "+=" and the Attach / Detach that i'm talking about.

Original thread: https://forums.rpgmakerweb.com/threads/yep-itemcore-attachaugments-cant-work-out-baseitem-params-or-item-params.122753/