In order for a PokéBen to learn a new ability, you need to have an ability scroll and the PokéBen has to have the same type as the new ability.
Each PokéBen has 4 ability slots by default and can potentially expanded to up to 10 slots using certain items. When attempting to learn, a PokéBen has a chance to learn the new ability in any of its slots, replacing the previous ability on that slot. And the learning also has a chance to fail.
You can add EBEN as catalysts on any of the open slots of your PokéBen to increase the chance for the new ability to be learned on.
100% of the EBEN cost used as catalysts is burned.
const base = 25;
const failure = base;
const slot1 = base + Math.sqrt(catalystsOnSlot1);
const slotN = base + Math.sqrt(catalystsOnSlotN);
const total = failure + slot1 + ...slotN;
const chanceOfFailure = failure/total;
const chanceSlot1 = slot1/total;
const chanceSlotN = slotN/total;