MV How Can I Code a Seven Card Hold Poker Game?

After successfully implementing traditional draw poker awhile back, this week I turned my attention to Texas-style hold poker, for which the rules are significantly different:
  1. No card replacements
  2. Cards are revealed in sets
  3. After each set you can increase your wager
  4. Two card start
  5. Three card flop
  6. Single card turn
  7. And one last card at the river for a total of seven cards
For reference purposes, the original game was implemented using the information over this way. However, aside from being able to reuse the card selection code I have a very significant drawback to the hand evaluation in its current form as it assumes five cards in total, so anything other than sets (read: a pair, two pair, or three or four of a kind) is being counted as a lost game. Would anyone be able to advise on how to update the card evaluation code so that I can both:
  1. Minimize code duplication, and
  2. Process the result accurately and completely without regard for the number of cards being used for the game?
Note that I have already implemented everything else using the instructions and code from before. Only thing I have left to do is to update the card processing code.

EDIT: To be clear, I would ideally process both games using the same code block as that is how everything is currently structured. I would also like to have odds calculations included in the code so that the payouts from both games are as accurate as possible, with a control switch or other value that can be set to determine which list of odds applies to the current game.

Original thread: https://forums.rpgmakerweb.com/threads/how-can-i-code-a-seven-card-hold-poker-game.159330/