Im trying to get the %stored cache to take over when the cache is depleted and then once the stored is empty the bot stats a hunt is needed, any help merging these would be greatly appreciated!

on $*:action:/[!](eats|eat|ate|munches|munched|munch|chowed|chows|chow)/Si:#:{
if (%health [ $+ [ $nick ] ] >= 100) {
.notice $nick 5,1| $+ %theme $+ $nick $+ 5|14You Already Have Full Health! 5|
return
}

var %restore1 = $iif($calc( 100 - %health [ $+ [ $nick ] ] ) < %cache, $v1, $v2)

else if (%restore1 <= 0) {
var %restore2 = $iif($calc( 100 - %health [ $+ [ $nick ] ] ) < %storedcache, $v1, $v2)
}
If (%restore2 <= 0) {
msg $chan 5,1| $+ %theme $+ $nick $+ 5|14Both the Cache & Stored cache is 4Empty,15 Council member call a hunt in 5#4D7R8*7H4u5nt 14 to replenish the cache/stored!

}

else if (%restore1 >= 0) {
dec %cache %restore1
inc %health [ $+ [ $nick ] ] %restore1
msg $nick 5,1| $+ %theme $+ $nick $+ 5|14You have just ate and restored7 %restore1 14health!!5|
msg $nick 5,1| $+ %theme $+ $nick $+ 5|14Remaining cache:7 %cache 14lbs 57Stored:14 %storedcache

}
else if (%restore2 >= 0) {
dec %storedcache %restore2
inc %health [ $+ [ $nick ] ] %restore2
msg $nick 5,1| $+ %theme $+ $nick $+ 5|14You Have Just Ate from the stored cache and restored7 %restore2 14health!!5|
msg $nick 5,1| $+ %theme $+ $nick $+ 5|14Remaining stored cache:7 %storedcache 14lbs
}
}


-Chan: #WolvenSpirit -Server: Irc.Sorcery.Net