Hello,
Your question is really all about programming. Writing macros is writing programs. Macros come in different languages. The most visible language to the user in LibreOffice is “Star Basic” written many years ago by Oracle. Not as visible are languages such as C++, Python and Java all which can be used to write macros.
Functions are macros. They simply return information when called upon. When you use LOG10(x) you are just calling a macro (mini program) with a name of LOG10 and a parameter (variable) of ‘x’. The macro uses ‘x’ in a specific manner to return information to the source of the call.
The language for macros may or may not contain ‘key’ words. LOG10(x) is NOT in Star Basic but IS in Python. Also, these key words may or may not be present depending upon the version of the language used.
One does not write macros using ‘cell functions’ but rather cell functions are created by writing macros.
If you do not already know how to write programs, this can be a very steep learning curve. There are also many side roads involved.
Your reference to the link is already a Function. So what you are stating is to write your own function based upon that already written. You must be careful in this respect as there are License restrictions according to the site where you got this from.