Nowadays, clean and sustainable energy development is of essential concern, which justifies use of renewable energy sources. Wind energy is an important resource to provide such a demand. Due to the high costs of wind power generation compared to other renewable sources, the wind turbines should be designed in such a way that they usually operate at the highest point of their power. In this case, because of the random and alternating wind speed, the output power of the wind turbine generators and thus the windfarms fluctuate. When the capacity of windfarms is increased, the power injected from the windfarm into the grid can have significant negative effects on the power grid stability. In order to prevent these effects, it is necessary to use BESSs in windfarms. To this end, a waveform with acceptable fluctuations is considered for the windfarm output power. This waveform is compared with the output power waveform and then the difference between the two waveforms is compensated by a BESS. Proper tracking with the minimum delay reduces the required BESS capacity and thus initial investment cost for the windfarms is significantly reduced. In this paper, using real windfarm data, the conventional tracking methods for the windfarm output power waveform are analyzed and compared, first. Then, a novel tracking scheme, namely the MSA, is proposed, which is based on a two-fold master-slave adaptive linear neuron. Acquired results show that compared with the conventional methods, using the MSA scheme can reduce the costs of a 99 MW windfarm by 4.8 million dollars.