I kind of do it a different way, but my way is inspired by some of Motenten's other spellcasts.
Have the same variables for obis
Code:
<var name="Obi-Ice">Hyorin Obi</var>
<var name="Obi-Light">Korin Obi</var>
<var name="Obi-Thunder">Rairin Obi</var>
<var name="Obi-Fire">Karin Obi</var>
<var name="Obi-Wind">Furin Obi</var>
<var name="Obi-Earth">Dorin Obi</var>
<var name="Obi-Water">Suirin Obi</var>
<var name="Obi-Dark">Anrin Obi</var>
I add an additional variable WeatherBonus
Code:
<var name="WeatherBonus">EmptySet</var>
I add a set EmptySet and a set WeatherBonus
Code:
<set name="EmptySet" />
<set name="WeatherBonus">
<waist lock="true">$Obi-%SpellElement</waist>
</set>
Finally, I have a rule (put it at the top or close to the top of your rules section).
Code:
<if skill="*Magic|Ninjutsu|Singing"> <!-- Doesn't have to be this, but this is mine -->
<if element="%DayElement|%WeatherElement">
<var cmd='set WeatherBonus WeatherBonus' />
</if>
<else>
<var cmd='set WeatherBonus EmptySet' />
</else>
</if>
Now, the last thing you do is set $WeatherBonus as a baseset for any set that you might want to use obis for. like so
Code:
<set name="Matk" baseset="$WeatherBonus">
<waist>Aswang Sash</waist>
</set>
It will use the belt you have in the set, unless weatherbonus is set, in which case the lock will force the obi.