To solve the path planning problem of Unmanned Aerial Vehicle (UAV) in multi-hazardous environments, a Behavioral Training Mechanism Based Partial Reinforcement Optimization Algorithm (BT-PRO) is proposed. In BT-PRO, an elite population strategy is proposed to optimize the initial population distribution and accelerate convergence speed. Then, a Gaussian perturbation-based global stimulation strategy is used during the stimulation phase to direct the learner population towards the optimal solution and augment the exploitation capacity of BT-PRO. Finally, a novel behavioral training mechanism is designed to enhance population communication, balance the exploitation and exploration of BT-PRO, and improve algorithmic search efficiency. After ablation experiments and verification using the CEC2022 benchmark test function, the experimental results indicate that BT-PRO exhibits superior optimization capability and robustness compared to other optimization algorithms. Furthermore, the UAV path planning problem is addressed through the BT-PRO algorithm. Experimental results show that BT-PRO can generate smooth and low-cost paths in both low-dimensional small-scale scenarios and high-dimensional large-scale scenarios. These findings substantiate the effectiveness of BT-PRO in resolving the challenges associated with UAV path planning.