I assume you mean you have a code similar to
seeing how being on the notify list has nothing to do with doing a hwois. The only fix then is to add the following line to the on notify event:
and then in the raw events triggered by the whois:
if (%notify == $2) { do stuff here }
as well as adding the following optional line for cleanip:
raw 318:*: if (%notify == $2) unset %notify