That is quite complicated.
However this will add ‘edit profile’ to you menu if you put it in your function file !
// Filter wp_nav_menu() to add profile link
add_filter( 'wp_nav_menu_items', 'my_nav_menu_profile_link' );
function my_nav_menu_profile_link($menu) {
if (is_user_logged_in()) {
$current_user = wp_get_current_user();
$user=$current_user->user_login ;
//Lower case everything
$user = strtolower($user);
//Make alphanumeric (removes all other characters)
$user = preg_replace("/[^a-z0-9_\s-]/", "", $user);
//Clean up multiple dashes or whitespaces
$user = preg_replace("/[\s-]+/", " ", $user);
//Convert whitespaces and underscore to dash
$user = preg_replace("/[\s_]/", "-", $user);
$profilelink = '<li><a href="/forums/users/' . $user . '/edit">Edit Profile</a></li>';
$menu = $menu . $profilelink;
return $menu;
}