The performance of a Half Bridge (HB) Modular Multilevel Converter (MMC) for D-STATCOM application is studied in this article. For the control of MMC switches, the Carrier-Based (CB) Pulse Width Modulation (PWM) scheme has been selected as the appropriate method. There are two types of CB PWM schemes such as phase shift and level shift. Phase Disposition (PD), Phase Opposition Disposition (POD), and Alternate Phase Opposite Disposition (APOD) are the three different types of PWM that are used in level shifts. The PD CB PWM is projected in this work due to its simplicity and accuracy. The conventional PI Controller (PIC) has its disadvantages, including that it is time-consuming and comes with complexity in the estimation of gain values. Hence, the Cuttlefish Optimization Scheme (COS) is proposed for the online tuning of the PI gain values. The verification of performance parameters, including active power, reactive power, DC voltage balance, and Total Harmonic Distortion (THD), is effectively conducted using the COS method and subsequently compared with the conventional PIC. The suggested research is executed using the Matlab/Simulink software package.