I am using Firebase cloud functions. Do I need to add an import tag when using something like Math.floor()?
JavaScript Firebase functions are written as "any other" JavaScript Node.js code. That includes imports.
Math is a global JavaScript object. There isn't any need to import it.
I think you need mostly look into the documentation how to start. And play with it yourself.