Cheers for the response.
The only way it could really work with Plex automating the whole thing would be to pass in all the episodes in the season to the seasonObject so that it could then itself work out the unplayed count (i.e: total number of items - number of played items)... and I'm not expecting Plex to make things that easy!
So I was potentially thinking a little lower level than that, with the plugin manually working out how many episodes in the season were unplayed.
It could do so by either manually querying Plex to see if each item had been played in the season (i.e: manually doing what Plex would need to do itself) or using some other means to know how which items had been played (e.g: using the underlying provider to keep track of which items have been played across any number of devices, some of which may or may not be Plex).
At the end of the day, looking at the XML that's generated when browsing a season stored on a local disk, the unplayed count is just an additional attribute of the season XML entity, which I'm assuming is set by working out the set difference of season items and unplayed items.
Any idea on how open the Plex devs are to taking Framework updates?