Smart Collection Filter - Last Played In x Days

That’s already there, if I understand you correctly:

As for using it to improve randomness, see this: