The X in Riku's ability is the number of times you chose a mode for the modal spell you cast, not the number of distinct modes you chose. For example, if you cast a modal spell that allows you to choose the same mode more than once and you choose the same mode three times, X is three and you may choose up to all modes of Riku's ability.