The advent of distributed generation has brought with it a plethora of challenges for the nascent power systems that are being deployed on a large scale. Firstly, the majority of power electronic converters connected to the grid are in current source mode, which results in a lack of inertia and an inability to provide effective inertia or achieve damping support during fluctuations in grid frequency. Secondly, the issue of power quality, caused by the presence of harmonics, is becoming increasingly severe. This is particularly problematic in microgrids or systems with high line impedance, where harmonics can be amplified, thereby further compromising the stability of the power system. To address the deficiency in system inertia, numerous scholars are currently utilizing grid-forming (GFM) technology to achieve virtual inertia. In order to address the issue of system harmonics, it is possible to install active power filter (APF) devices at the point of common coupling (PCC), which serve to mitigate the effects of harmonics. This paper puts forth a proposal for the implementation of an APF with virtual inertia, based on PR + RC composite control. This composite control mechanism serves to enhance the harmonic suppression capabilities of the APF. The introduction of a frequency droop enables the capacitor voltage amplitude to be adjusted during fluctuations in system frequency, thereby achieving virtual inertia and providing active support for system frequency. The experimental results demonstrate that this strategy not only reduces the total harmonic distortion (THD) by 13% in comparison to PI control, indicating excellent harmonic suppression performance, but also allows the system to be inert, achieving positive results in suppressing frequency fluctuations during transients.