I'm not certain that this is the final desired behavior, but this is how it currently works:
A user can edit or remove their own topic indefinitely as long as it has NO replies. Once there is a reply, it can not be edited or removed by the user.
A user can edit or remove their own reply indefinitely as long as it has NO COMMENTS.
A user can STILL edit or remove their own reply even if there are other REPLIES following it.
A user can edit or remove their own comment indefinitely even if there are replies below OR even if there's ANOTHER COMMENT following the comment.