This script allows for 2 abilities to be assigned to classes. Then one is chosen at random and with one of the following two scripts the effects can be added.
What are Abilities?
From the Bulbapedia page on Abilities
“Abilities (Japanese: とくせい special characteristic) are a game mechanic introduced in Generation III. Individual Pokémon may have only one of these special attributes at a time, which generally serve to assist them in battle. An Ability cannot be changed after a Pokémon is obtained except by evolution, where the Ability it changes into is determined by the former Ability and form change. Not every Ability is beneficial; some will hinder the user.”
<ability: x, y> Sets the abilities that the class can have
<hidden ability: x> Sets the ability to be drawn out
$game_actors[x].get_hidden_ability Sets actor x’s ability to the class’s hidden