js function to count task points