Can you make a player take damage depending on how long they fall?

This is similar to this post. Look at my answer at the bottom, you might need to tweak a few things.