Create a file with functions usable in different projects

Godot Version

Godot 4.3

Question

Hello, nice to meet you all. New here.

I never programmed or did a videogame before, just watched some tutorials on basic programming and such, I hope my question is not absurd.

So, I have set myself on building a game but I know the idea I have right now is too complex and difficult to implement for a newbie like me. My idea to “solve” this problem ahs been to separate the final game in chunks by mechanics and systems the game will require, and build smaller games, each game implementing only 1 single mechanic or system of that bigger problem.

This would help me learn programming, the game engine and get used to it and at the same time save time when I finally set out for the bigger project.

Now my question would be, is it possible to create files in godot that contain functions and so that I programm and call that same file in different projects?

Let me explain better just in case.

Immagine my objective projects is a platformer game where my character will have different abilities (invert gravity, launch ice ball, shield himself to prevent damage, etc)

So I will program a small game where the only mechanic is inverting gravity and play around that.

I don’t want to program that twice, I dont want to have to rewrite code and so in 2 projects.

Is it possible in Godot to just create a file called for example “gravity_inversion_functions” Where I programm all the stuff related to gravity inversion and I can import that on other projects to have that mechanich ready to go maybe with just small tweakings?