Throwing if grabbing an object

Hi, I am making a sports game and I need help with the code.

I want it so if the player presses the G key they grab and when grabbing they can throw.
This script is on the collider of the Player.
There I have 2 booleans: throwing and grabbing

Here is the code:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class GrabZonePlayer1 : MonoBehaviour
{

    [SerializeField] Transform ball;
    [SerializeField] Player1 player;
    [SerializeField] Vector2 ballPlayerVector;
    [SerializeField] GameObject Hands;
    [SerializeField] float powerX;
    [SerializeField] float powerY;
    bool grabbing;
    bool throwing;

    void Start()
    {
        ballPlayerVector = ball.transform.position - player.transform.position;
        grabbing = false;
        throwing = false;
    }

    
    void Update()
    {
        
        
                if (Input.GetKeyDown(KeyCode.G))
                {
                  if (grabbing == true)
                  {
                    throwing = true;
                    ball.transform.position = Hands.transform.position;
                    ball.transform.parent = Hands.transform;
                  }
                    
                  if(throwing == true)
                  {
                    if (Input.GetKeyDown(KeyCode.T))
                    {
                       grabbing = false;
                       ball.GetComponent<Rigidbody2D>().velocity = new Vector2(powerX, powerY);

                    }
                  }

                }

            

        
        
        
            
        
    }

    private void OnTriggerEnter2D(Collider2D other)
    {
        if(other.tag == "Ball")
        {
            grabbing = true;
            
        }
    }

    

    
}

Thanks.

@CBD677 In your code, you need to press G and T at the same time to throw, IDK if this is the desirable behavior, but try to remove the throwing conditional from inside de G key conditional and things will “work” properly

[SerializeField] Transform ball;
    [SerializeField] Player1 player;
    [SerializeField] Vector2 ballPlayerVector;
    [SerializeField] GameObject Hands;
    [SerializeField] float powerX;
    [SerializeField] float powerY;
    bool grabbing;
    bool throwing;
 
    void Start()
    {
        ballPlayerVector = ball.transform.position - player.transform.position;
        grabbing = false;
        throwing = false;
    }
    
    void Update()
    {
        if (Input.GetKeyDown(KeyCode.G))
        {
            if (grabbing == true)
            {
                throwing = true;
                ball.transform.position = Hands.transform.position;
                ball.transform.parent = Hands.transform;
            }
                     
        }
        
        if (Input.GetKeyDown(KeyCode.T))
        {
            if (throwing == true)
            {
                grabbing = false;
                ball.GetComponent<Rigidbody2D>().velocity = new Vector2(powerX, powerY);

            }
        }
    }
 
    private void OnTriggerEnter2D(Collider2D other)
    {
        if(other.tag == "Ball")
        {
            grabbing = true;
             
        }
    }

Thanks but there is another problem when i move the player the ball moves with him even if its thrown.

Maybe thats because the script is on the Grab Zone Game Object .
but idk how to fix it.