If doing it by states:
Let's say you make a state for each parameter buff.
Assuming Beef is an item, you will put this in the damage formula:
eval $data_items[ITEM-ID].note[/<formula>(.*?)<\/formula>/m, 1]
ITEM-ID = the ID of the item in the database
In the notebox, you put
<formula>
(What you would normally put in the damage formula)
</formula>
What you normally would've put is:
<formula>
rand(4) = v[x]; if v[x] == 1; a.add_state(27); end; if v[x] == 2; a.add_state(28); end; if v[x] = 3; a.add_state(29); end; if v[x] = 4; a.add_state(30); end; 0
</formula>
"x" in v[x] is the variable ID (You will need a variable with this)
The 0 is at the end in case no numerical value is added or subtracted. The skill should look like this:
Haven't tested it, but it should work. The code in the damage formula tells the database to look in the notebox of the specified Item ID (or skill).
If anything doesn't make sense, don't be afraid to ask ^_^