The article presents the application of total productive maintenance (TPM) to analyze the working time indicators of casting machines with particular emphasis on failures and unplanned downtime to reduce the proportion of emergency operation for preventive maintenance and diagnostics. The article presents that the influence of individual factors of complex machinery maintenance (TPM) is different and depends on the machines' modernity level. In an original way, by using correlation graphs, research findings on the impact of individual TPM factors on the castings quality were presented and interpreted. The examination results conducted for machines with varying modernity degrees allowed to determine changes within the impact of individual TPM factors depending on machine parameters. These results provide a rich source of information for the improvement processes on casting quality of the foundry industry that satisfies the automotive industry demand.