Hi,
Thanks for posting your question!
You might want to check out this community post - Reporting on Comments by user both internal and external - Help! - #2 by Marita_Norvele It has an example of JavaScript codes that counts Internal and External comments. Note that the code will only work in Cloud instance.
Best wishes,
Elita from support@eazybi.com