Modern Algebra Automatic trigger

Hey,
So I'm using this script:
I'm wondering if it's possible to add an automatic trigger (if a certain switch is on), e.g. you gather 5 potions (subquest by your teammate) and once you have 5, the quest automatically completes and you get the rewards/some dialogue, and the 5 potions are taken away from your inventory.
Is that possible?
it should be, with a hook to the gain_item routine, but this system doesn't seem to do any processing on it's own.
I mean, it's an extension of event-driven checks, it doesn't hold data about what the conditions are for each objective.

for example, on that sample quest, objective 3: "Take Ladia back to Boris"... there's no check for Boris, or Ladia, or any NPC ID, or any location whatsoever. So, how do you check for Ladia being nearby Boris, wherever Boris might be?
that check must be performed at event time, by Boris's routine, and upon having party member "Ladia" around, *it* will ping the system and validate it.
How are you collecting the potions?
And what gstv87 said. Processing the quests and collecting the rewards is all manual.
The script just facilitates a scene to view the quests and processing of the quests by event commands.
Ah I see, that explains it.
Well, the potions were an example, say, it's 5x a monster's tooth, you'd collecting it by battling monsters.

Original thread: https://forums.rpgmakerweb.com/threads/modern-algebra-automatic-trigger.148440/