You can hook into the variable that function calls and modify it directly to set which weapon a skill is using. This isn't really an intended feature, but if you eval in the code
the next attack animation will be with the offhand (and possibly might even deal the right damage with the example given by
@Waterguy above.
So since you asked for an example, I'll see what I can do.
<Setup Action>
display action
camera focus: user
zoom: 200%
wait for camera
cast animation: user
wait for animation
</Setup Action>
<Target Action>
wait: 20
motion attack: user
wait: 10
camera focus: target, 5
wait for camera
action animation: target
wait for animation
action effect: target
wait: 20
</Target Action>
<Finish Action>
clear battle log
reset zoom
reset camera
perform finish
wait: 10
</Finish Action>
The above sequence is pretty basic. Target runs to enemy, swings, does damage, returns to start. If this was your attack skill sequence, the same thing would happen, except the target section actually plays twice, with the second motion attack: user showing your offhand weapon. If we assume that this isn't your attack skill, and it is just an ordinary skill, my plugin will have absolutely no effect on this particular sequence. It will hit once, and only show the main hand weapon. If we change the sequence so that it contains two 'motion attack: user', it will alternate weapons automatically. It is worth noting that damage splitting will not happen on this skill even though it shows two different weapons, because this skill isn't tagged as a dual wield skill.
If we change the sequence as follows:
<Setup Action>
display action
camera focus: user
zoom: 200%
wait for camera
cast animation: user
wait for animation
</Setup Action>
<Target Action>
wait: 20
eval: user._numAttacks = 1
motion attack: user
wait: 10
camera focus: target, 5
wait for camera
action animation: target
wait for animation
action effect: target
wait: 20
</Target Action>
<Finish Action>
clear battle log
reset zoom
reset camera
perform finish
wait: 10
</Finish Action>
The single attack shown in the sequence will now be for the offhand weapon. If we add a second motion attack it will alternate between the offhand and mainhand weapons. If we use this sequence for your normal attack,
it will never show the mainhand weapon, because the plugin is designed to redo the entire target action part of the sequence, which will force it to show the offhand forever.
We can use that eval command to specify when to show the offhand and when to show the mainhand though, so that's pretty much what you need. Use it well.