(I should really look to see where I'm posting before doing so. I'm not familiar with VXAce and am not sure if they have Self Switches or not. If no, I apologize, but in that case, just replace self switches with regular switches)
Basic variable manipulation is fairly simple.
In this particular case, you need to have your different NPCs. I'm using 4 in my explanation, but you can tweak it however you wish. 3 of them will be used as the NPCs to talk to, the fourth will be used to check the variable and advance the plot.
When setting up your NPCs, there are two commands you will want to use. Control Variable and Control Self Switch. Control Variable will allow you to change a variable's number whenever you talk to them. Control Self Switch will enable you to make it so that particular NPC can only add to the variable's number a single time.
Spoiler
As you can see, the first time you talk to him while there's no predetermined conditions, he says his piece, adds +1 to the variable "Duders Talked To", and enables Self Switch A. In the second picture, Self Switch A is enabled, so page two will automatically trigger any time you talk to him after the first, preventing him from adding to the variable multiple times. Do this for however many NPCs you want to use to affect the variable (so in your case, 3)
After you make your 3 NPCs to talk to, you need to make something for the variable to trigger. I used an NPC, but its possible to do it on a "Move Location" command, or even an Autorun Trigger to make something happen immediately after you talk to the third.
In this situation, page 1 has no set conditions. so talking to the NPC will result in him telling you to talk to the others first. However, once you've finished talking to the three other NPCs and gotten the "Duders Talked To" variable up to 3 or greater, page 2 will trigger, and he will instead congratulate you on accomplishing this monumental task laid before you. Again, this doesn't necessarily have to be an NPC, I just chose to use it to demonstrate for simplicity sake.
And that's it. Basic Variable Usage 101. Now if I could only get someone to teach ME how to properly use spoilers tags so I stop posting giant walls of images XD