Getting Yanfly Skill Cost Manager to consume items

Hi, everyone! I'm really hoping someone can help me on this...

Let me preface this by saying that while I have a general understanding of programming languages, I don't know anything about Ruby and am not anywhere near trying to write scripts. I'm really just trying to make a game that sometimes pushes the boundaries of what the program is ready to do.

So Yanfly's Skill Manager adds some great functionality, but it's a little vague on how custom costs work. What I'm trying to do is basically use the custom cost to count ammunition for weapons. I want to check that there is at least 1 of the item and then subtract 1 item when the skill finishes. I did a lot of searching and went over other people's formulae, but it's just not working as I thought it should. So please help! Here is what I've worked and worked to put together (I basically spent all day on these 2 stupid lines of code):

<custom cost requirement>
$game_party.item_number($data_items[17]) >= 1
</custom cost requirement>

<custom cost perform>
$game_party.lose_item($data_items[17], 1)
</custom cost perform>

My fingers are crossed that some brilliant mind will have an answer!
Exactly what is wrong with the script?
Your note-tags should work, so it should check for the item, and consume the item on usage.

I suspect a compatibility issue. Which other custom scripts are you using?
I didn't think of that. I'm happy that at least I figured out the right syntax! I'm guessing that it's Skill Self Effects by Jet10985. I'm also running Yanfly's Battle Engine 1.09, but I obviously doubt it's that. I may be able to delete Jet's script, since I think the Yanfly probably will mainly cover what I wanted to do, but if you have any thoughts on what the conflict would be and if there's a simple fix, I'd really appreciate it!

To add a bit of detail, the actual function of the 2 lines currently is: 1) it displays an item cost of 0, 2) it allows the skill to function infinitely, and 3) weirdest of all, it seems to *add* items rather than subtracting them.
Ohh, wow, now that is a rather unexpected result from those note-tags. 😳
Just tested your note-tags and it works for me perfectly.
For the cost display, you will have to set that up yourself with other note-tags, for example:
Code:
<custom cost: 1x>
<custom cost icon: 197>
This would display as: 1x[icon 197 goes here] .

It is not Jet's script for sure, that one uses different methods.
Not the Battle Engine either.

You can check the methods used in the Skill Cost Manager script (only from the Game_BattlerBase class there), and search for them with CTRL+SHIFT+F. Always search for the definition line, so:
Code:
def method_name_here
Do not include the arguments, nor the bracket (if there is any) after the method name.
List any custom scripts you find altering the same methods, so any match you find except from the default scripts.
If there is a compatibility issue, it is from one of the scripts you find that way.
Thank you for your help! And I'm sorry! I discovered the problem. I assigned the code to a different skill and it worked. Then I realized that the battle I was testing it in had some code in it from an earlier test that was linked to the item I changed to ammunition. So I never realized I got the right answer, because that code was overwriting what it should have been doing. So thank you for your patience! But now I know the syntax for the custom cost and how to show the costs visually. Case closed.

Original thread: https://forums.rpgmakerweb.com/threads/getting-yanfly-skill-cost-manager-to-consume-items.80403/