How to make a random buff?

I have an item that I would like to have a random buff given during battle for 3-5 turns. The buffs being either Attack, Defense or Agility. How does one do this?

Edit: I was thinking maybe a common event could do this??? I'm not sure though.
Your best bet is probably a plugin or script, just because common events have trouble knowing who the target and/or user is. You could do it without much trouble through Yanfly's Skill Core, by adding an effect tag to the item that runs some javascript that picks one of the three stats and durations at random and applies the buff.
I would do script but I refuse to use plugins. But thanks.
Not using plugins will probably make stuff difficult for you in the long run, but it's your choice. 😅

Here's an example of a damage formula that I think ought to apply a random buff (atk, def, or agi; 3~5 turns) to the target, then do 20 damage/healing: 😤
Code:
var param = [2,3,6][Math.randomInt(3)], turns = 3 + Math.randomInt(3); b.addBuff(param, turns); 20

Original thread: https://forums.rpgmakerweb.com/threads/how-to-make-a-random-buff.104680/