You can implement this by using a microflow.
First add an attribute of count.
And on the button that downloads the file, change it to a microflow and do all the default activity which it should do and at the end, add a change activity which increases the count by 1 each time it is clicked.
This way you'll know how many times the download button has been clicked.
Hope it helps!