And in any case your totalCount is a completely different thing than the itemCount of my long ago prior post.
But in any case, I don't see how I can help you without knowing all the fields in your tables.
For example, I have no idea what field(s) to use to determine " the most recent comment that was made on an item where the logged in user is part of the conversation (but not necessarily the owner)".
I see nothing at all in your query that gives me the field names needed to determine if a given user is part of a "conversation".
An optimist sees the glass as half full.
A pessimist sees the glass as half empty.
A realist drinks it no matter how much there is.