From what you've written, a simple solution would be to add a global variable and then set it to add one whenever the event happens.
globals [counter]
to setup
...
set counter 0
...
end
to do-the-thing
...
event-you-want-to-count
set counter counter + 1
end
It'll look different depending on what you're trying to count, but that's the basic idea. If you want to use it in a function, plug 'counter' into it. If you don't want to keep track of the counts by means of a variable you could write a reporter, but you'd need to give some more detail for suggestions (at least from me).