This scriptlet has a single function: Simplify the "Active Time" part of "Active Time Battle." To achieve this, it uses two classes: ATB::Group, and ATB::Client.
ATB::Group is a subclass of Array that allows for updating of held clients and has support for advanced subclassing tricks (namely, overwriting ATB::Group#modifier to dynamically change the rate at which clients update), and you use it exactly the same as Array except for the presence of Group#update, which you call every time you want to update the clients in the group.
ATB::Client is a custom class I wrote that holds data on an ATB "client," which is one of the battlers or actions involved in the ATB that has something to do and a rate at which it prepares to do it. To create one, you call ATB::Client.new with one argument, which is the rate that it should prepare at in percentage. In addition, you pass a block that takes the client as an argument. This block is called when the client finishes preparing.
client = ATB::Client.new(1.0) do |client|
client.rate = 0 # Client stops doing things when it does the first thing
end
When creating your ATB, you will simply use these two classes to handle the ATB interactions - create groups and clients for your enemies and actors, and update them accordingly.