In the Advanced Editor, go to the Scripts section. You will see a list of all scripts currently in your game. At the top, you will see Global Link and Global Page.
If you want something to happen when EVERY link is clicked, you open up Global Link and write a script there.
For example, adding to the same variable every time a link is pressed.
%VARIABLE := %VARIABLE + 1
If you only want it to go up every three links, all you have to do is make a second variable to act as a "counter". The "counter" variable would go up each time a link is clicked, and when it reaches three, it adds +1 to your main variable, and resets the counter to zero. So you might have a script like this instead:
%COUNTER := %COUNTER + 1
IF %COUNTER = 3 THEN
BEGIN
%COUNTER := 0
%VARIABLE := VARIABLE + 1
END