The Custom Stats Guide has an overview of how custom stats work, and the Tutorial: Custom Reports and Statistics goes into detail about how to create stats, including how to make a new version of a stat from an existing similar stat. (The latter was written for PT3, but the same principals apply.)
Take a look at how the normal Fold to Turn Float and any "in 3bet pot" stat to see what expressions you need to use.
If you get stuck post what you've got so far, or what you're having a problem with, and we'll help you out.