I'm not familiar with the game you're referencing; do you want this to happen in or out of battle? It can be done either way;
Out of battle:
Add a method to game party
def reg_sp
@waiter += 1
if @waiter == m
for actor in @actors
actor.sp += (k * actor.max_sp)/100
actor.sp = [actor.sp, actor.max_sp].min
end
@waiter = 0
end
end
k is the percent of sp to gen back.
m is how many frames you get this percent back
Finally,
under initialize in $game_party add @waiter = 0
and towards the bottom of the update loop in $scene_map add $game_party.reg_sp.
Doing this in battle is pretty much the same, but I'm guessing that it's for the map.
If you do want this for battle, I can help you if you want