The first thing we need is a table of what we are currently afflicted by, and a flag to show if we are currently eating a cure.
Next, we want a table of the various afflictions and their cures. We'll use a numerically indexed table to make prioritising afflictions easier.
Now we want a "cure me" function, that can be called on the prompt. I prefer to cure off the prompt, rather than on the affliction/eat/balance lines, so that you can have as much information as possible for your function to choose the best course of action.
What this does is first test for whether we can cure anything right now (eg. if we have just eaten we can't).
Then it goes through the cures table in sequence, and for each one, checks to see if we are afflicted by that thing. That way the most important things get cured first.
When it finds one, it pulls the herb out of the bag and eats it, and echo's what we are currently eating.
----------------------------------------------------------------------------------------------------------------------------------------
Next we need to gather the healing balance triggers. Examples, "You may eat another herb." or "You may apply another salve." etc... and set eating to false so that when we regain herb balance the function do_cure() will attempt to cure another herb affliction.
Next we gather affliction and cure triggers, to use these functions in.
The above techniques won't be perfect, for one thing it doesn't check if you actually have the herb in your inventory. You might maintain another table of the herbs you are carrying, which could be updated when you buy them, and when you use them. However it should be enough to give you some ideas.
Again this is just a rough basic outline of how you could do this. It isn't intended to be a complete system build. Its intended purpose is to open you up to a method of doing things. To give you an idea of where to start and how to get there. I hope and encourage others to post similar methods, assuming they don't have a monetary investment in them, like Vadi.