Well, it did work!
Put the function in “bp-custom.php”, and called teh function from the template file.
And thanks to you r-a-y, for the right input.
Now it’s a matter of styling the menu.
I should be able to get the dropdown effect only with CSS, witthout any jQuery, right?
When I got the result I want, I’ll mark this as resolved.
Thanks guys, that was an important feature to have for the site.