per passare alla funzione textCounter il riferimento all'oggetto textarea basta this

codice:
onKeyDown="textCounter(this, ...