This should, in theory, work:
Have your character perform the skill which runs a common event as well as does (null) or 0 damage to an Enemy Target.
Within that common event, use a variable call for the amount of money the player has. If the variable checks out to the amount of gold needed, then use the "Force Action" button within the battle event page to force your character to use said skill against the "last target." Alternatively, you can Force Action to just use the skill on a random enemy, or you can define it using even more variables (but I would not recommend this, it may get quite convoluted and lead to unwanted skill use/skill use to the wrong enemy.)
There are a million ways to skin a cat. Be wary of anybody who states that there is "only one way to do" something.