Make a button that countsDown the credit.

Good morning ! I would like to operate a button that will be used to debit the credit account of a connected user who wants to take a project on the Platform. Here is an example of code that I tried to elaborate in capture, but it does not work yet I am not yet expert velo.
this is my button ID: #creditbutton.

I created an external file named credit.js in which I would like to create the functions that will be used for my button.

Here is the code I put in my external credit.js file


Here is the function related to the button. help find the right formula with velo. Thanks in advance.

Hi @reswebdev can you help me please bro. Thanks