As per AS 13, the concept of reducing the cost of Investment comes only when dividend/interest clearly represents the recovery of cost. Generally dividend amount will be reduced from the cost in the following two cases
1. when the investments are purchased on cum dividend basis.
2. when the dividend is declared out of pre acqisition profits.
For your easy reference, I am reproducing the Para 12 of AS 13 here:
Interest, dividends and rentals receivables in connection with an investment are generally regarded as income, being the return on the investment. However, in some circumstances, such inflows represent a recovery of cost and do not form part of income. For example, when unpaid interest has accrued before the acquisition of an interest-bearing investment and is therefore included in the price paid for the investment, the subsequent receipt of interest is allocated between pre-acquisition and post-acquisition periods; the pre-acquisition portion is deducted from cost.When dividends on equity are declared from pre-acquisition profits, a similar treatment may apply. If it is difficult tomake such an allocation except on an arbitrary basis, the cost of investment is normally reduced by dividends receivable only if they clearly represent a recovery of a part of the cost.