I’m having trouble with inputting stats at the start of the game

The character starts with skill 8, stamina 17 and luck 8.You can add 6 points to these stats, skill and luck can be a maximum of 12 abd stamina can go to 24 (although only up to 23 at the start of the game if you give all 6 points to it)

I am struggling as the coding I have done allows you to add up to 4 to the skill and luck stat , but doesn’t reduce available points subsequently so you can for example add 4 skill then 4 luck, this should be 4 skill then only 2 luck

My code looks like this:

```
*label init
*set ap 6
*temp skill_limit
*temp stamina_limit
*temp luck_limit
*set skill_limit 4
*set stamina_limit 6
*set luck_limit 4
*label choose_stats
You have ${ap} AP left to spend to increase your stats. Which stat do you want to increase?
*choice
*hide_reuse #skill
How many AP will you spend to increase skill? (1 - ${skill_limit})
*input_number stat1 1 skill_limit
*set skill +stat1
*goto adjust_ap
*hide_reuse #stamina
How many AP will you spend to increase stamina? (1 - ${stamina_limit})
*input_number stat1 1 stamina_limit
*set stamina +stat1
*goto adjust_ap
*hide_reuse #luck
How many AP will you spend to increase luck? (1 - ${luck_limit})
*input_number stat1 1 luck_limit
*set luck +stat1
*goto adjust_ap
#I'm finished spending AP
*goto done
#Reset stats and AP
*goto init
*label adjust_ap
*set ap -stat1
*if ap < 1
*goto done
*goto choose_stats
*label done
*goto_scene club
```

```
Example
*commend
Indent
```