Hit or Miss purely based on an AGI formula. Possible?

I've searched the forums and tried to mess around with the script but couldn't really come up with a way to do the following:

A formula that gives 100% hit or 100% miss on an enemy, based on the AGI paramater; if the enemy ( B ) has double or more AGI than the actor (A) the actor's attack would always miss, if not, always hit.

I'm a complete beginner in scripting, I tried adding something like (return rate * 0 if b.agi > a.agi * 2) on the "Calculate Hit Rate of Skill/Item" of the Game_Battler section.

Is it possible to make a formula that simulates what I'm trying to achiev? Thank you in advance. 
Well, you could make it be certain hit then use a custom formula to make it so  b.agi >= (a.agi * 2) ? (damage here) : 0 ...
I never thought you could actually put multiple formulas with ifs and elsifs on the skill formula text box, sorry about that, and thank you very much!

Original thread: https://forums.rpgmakerweb.com/threads/hit-or-miss-purely-based-on-an-agi-formula-possible.28867/