I suggest taking the approach author of A Tale of Heroes did in it what he has done is added a variable plural
, now this helps in statements like “Yes, she is” which would come out as “Yes, they is”, which would be wrong, so in it, he has added a check like “Yes, ${he} @{plural are|is}”, now what happens is plural
is set to true when they/them pronoun is selected, and then the following statement comes out as “Yes, they are”
I suggest taking a similar approach.